merge pr/KingBright/13
This commit is contained in:
@@ -31,10 +31,12 @@ fn hunyuan_ocr_generate() -> Result<()> {
|
||||
]
|
||||
}
|
||||
"#;
|
||||
let model_path = "/home/jhq/huggingface_model/Tencent-Hunyuan/HunyuanOCR/";
|
||||
let save_dir =
|
||||
aha::utils::get_default_save_dir().ok_or(anyhow::anyhow!("Failed to get save dir"))?;
|
||||
let model_path = format!("{}/Tencent-Hunyuan/HunyuanOCR/", save_dir);
|
||||
let mes: ChatCompletionParameters = serde_json::from_str(message)?;
|
||||
let i_start = Instant::now();
|
||||
let mut model = HunyuanOCRGenerateModel::init(model_path, None, None)?;
|
||||
let mut model = HunyuanOCRGenerateModel::init(&model_path, None, None)?;
|
||||
let i_duration = i_start.elapsed();
|
||||
println!("Time elapsed in load model is: {:?}", i_duration);
|
||||
let i_start = Instant::now();
|
||||
@@ -79,10 +81,12 @@ async fn hunyuan_ocr_stream() -> Result<()> {
|
||||
]
|
||||
}
|
||||
"#;
|
||||
let model_path = "/home/jhq/huggingface_model/Tencent-Hunyuan/HunyuanOCR/";
|
||||
let save_dir =
|
||||
aha::utils::get_default_save_dir().ok_or(anyhow::anyhow!("Failed to get save dir"))?;
|
||||
let model_path = format!("{}/Tencent-Hunyuan/HunyuanOCR/", save_dir);
|
||||
let mes: ChatCompletionParameters = serde_json::from_str(message)?;
|
||||
let i_start = Instant::now();
|
||||
let mut model = HunyuanOCRGenerateModel::init(model_path, None, None)?;
|
||||
let mut model = HunyuanOCRGenerateModel::init(&model_path, None, None)?;
|
||||
let i_duration = i_start.elapsed();
|
||||
println!("Time elapsed in load model is: {:?}", i_duration);
|
||||
let mut stream = pin!(model.generate_stream(mes)?);
|
||||
|
||||
Reference in New Issue
Block a user