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
+15 -1
View File
@@ -3,7 +3,7 @@ pub mod img_utils;
pub mod tensor_utils;
pub mod video_utils;
use std::{fs, process::Command};
use std::{fs, path::PathBuf, process::Command};
use aha_openai_dive::v1::resources::{
chat::{
@@ -490,3 +490,17 @@ pub fn get_default_save_dir() -> Option<String> {
path.to_string_lossy().to_string()
})
}
pub fn get_file_path(file: &str) -> Result<PathBuf> {
let path = url::Url::parse(file)?;
let path = path.to_file_path();
let path = match path {
Ok(path) => path,
Err(_) => {
let mut path = file.to_owned();
path = path.split_off(7);
PathBuf::from(path)
}
};
Ok(path)
}