From b28b6aa25d309cc17455d2ca806155d518359c6d Mon Sep 17 00:00:00 2001 From: wxg <1584929962@qq.com> Date: Thu, 25 Sep 2025 12:25:24 +0800 Subject: [PATCH] fix error --- src/lib.rs | 6 +++--- src/models/mod.rs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 264715b..b3e564e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,15 +18,15 @@ impl ModelType { model_path: &str, device: Option<&Device>, dtype: Option, - ) -> Result> { + ) -> Result> { match model_type { ModelType::Qwen2_5VL => { let model = Qwen2_5VLGenerateModel::init(model_path, device, dtype)?; - Ok(Box::new(model)) + Ok(Box::new(model) as Box) }, ModelType::MiniCPM4 => { let model = MiniCPMGenerateModel::init(model_path, device, dtype)?; - Ok(Box::new(model)) + Ok(Box::new(model)as Box) } } } diff --git a/src/models/mod.rs b/src/models/mod.rs index c84b1dd..120e531 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -1,6 +1,6 @@ -pub mod qwen2_5vl; -pub mod minicpm4; pub mod base_modules; +pub mod minicpm4; +pub mod qwen2_5vl; use anyhow::Result; use candle_core::{DType, Device}; @@ -17,5 +17,7 @@ pub trait GenerateModel { fn generate_stream( &mut self, mes: ChatCompletionParameters, - ) -> Result>>; + ) -> Result>> + where + Self: Sized; }