fix aha run multiple inputs bug
This commit is contained in:
+11
-6
@@ -1,19 +1,24 @@
|
||||
//! MiniCPM4-0.5B exec implementation for CLI `run` subcommand
|
||||
|
||||
use std::time::Instant;
|
||||
|
||||
use anyhow::{Ok, Result};
|
||||
|
||||
use crate::exec::ExecModel;
|
||||
use crate::models::{GenerateModel, minicpm4::generate::MiniCPMGenerateModel};
|
||||
use anyhow::{Ok, Result};
|
||||
use std::time::Instant;
|
||||
use crate::utils::get_file_path;
|
||||
|
||||
pub struct MiniCPM4Exec;
|
||||
|
||||
impl ExecModel for MiniCPM4Exec {
|
||||
fn run(input: &str, output: Option<&str>, weight_path: &str) -> Result<()> {
|
||||
let target_text = if input.starts_with("file://") {
|
||||
let path = &input[7..];
|
||||
fn run(input: &[String], output: Option<&str>, weight_path: &str) -> Result<()> {
|
||||
let input_text = &input[0];
|
||||
let target_text = if input_text.starts_with("file://") {
|
||||
// let path = &input[7..];
|
||||
let path = get_file_path(input_text)?;
|
||||
std::fs::read_to_string(path)?
|
||||
} else {
|
||||
input.to_string()
|
||||
input_text.to_string()
|
||||
};
|
||||
|
||||
let i_start = Instant::now();
|
||||
|
||||
Reference in New Issue
Block a user