dynamic home dir & model donwload script

This commit is contained in:
KingBright
2026-01-05 15:21:15 +08:00
parent 26fccaa0f6
commit 4e35866a59
15 changed files with 378 additions and 56 deletions
+3 -2
View File
@@ -8,7 +8,8 @@ use anyhow::Result;
fn robo_brain_generate() -> Result<()> {
// test with cuda: RUST_BACKTRACE=1 cargo test -F cuda robo_brain_generate -r -- --nocapture
let model_path = "/home/jhq/huggingface_model/BAAI/RoboBrain2.0-3B/";
let save_dir = aha::utils::get_default_save_dir().ok_or(anyhow::anyhow!("Failed to get save dir"))?;
let model_path = format!("{}/BAAI/RoboBrain2.0-3B/", save_dir);
let message = r#"
{
@@ -28,7 +29,7 @@ fn robo_brain_generate() -> Result<()> {
"#;
let mes: ChatCompletionParameters = serde_json::from_str(message)?;
let i_start = Instant::now();
let mut model = Qwen2_5VLGenerateModel::init(model_path, None, None)?;
let mut model = Qwen2_5VLGenerateModel::init(&model_path, None, None)?;
let i_duration = i_start.elapsed();
println!("Time elapsed in load model is: {:?}", i_duration);