add minicpm with a bug

This commit is contained in:
jhqxxx
2025-09-25 12:09:25 +08:00
parent ec989f397f
commit 4fdab3e7cd
15 changed files with 900 additions and 49 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
use crate::models::{GenerateModel, qwen2_5vl::generate::Qwen2_5VLGenerateModel};
use crate::models::{minicpm4::generate::MiniCPMGenerateModel, qwen2_5vl::generate::Qwen2_5VLGenerateModel, GenerateModel};
use anyhow::{Ok, Result};
use candle_core::{DType, Device};
pub mod chat_template;
@@ -9,6 +9,7 @@ pub mod utils;
pub enum ModelType {
Qwen2_5VL,
MiniCPM4,
}
impl ModelType {
@@ -22,6 +23,10 @@ impl ModelType {
ModelType::Qwen2_5VL => {
let model = Qwen2_5VLGenerateModel::init(model_path, device, dtype)?;
Ok(Box::new(model))
},
ModelType::MiniCPM4 => {
let model = MiniCPMGenerateModel::init(model_path, device, dtype)?;
Ok(Box::new(model))
}
}
}