fix aha run multiple inputs bug

This commit is contained in:
jhqxxx
2026-01-31 18:37:28 +08:00
parent fe299c3401
commit 16e3aefaa7
16 changed files with 308 additions and 123 deletions
+11 -6
View File
@@ -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();