update model_name

This commit is contained in:
jhqxxx
2026-03-30 20:33:48 +08:00
parent db2d3a1eb4
commit ccbe799b90
15 changed files with 106 additions and 175 deletions
+6 -2
View File
@@ -42,7 +42,11 @@ impl<'a> Qwen3GenerateModel<'a> {
let generation_config_path = path.to_string() + "/generation_config.json";
let generation_config: Qwen3GenerationConfig =
serde_json::from_slice(&std::fs::read(generation_config_path)?)?;
let model_name = std::path::Path::new(path)
.file_name()
.and_then(|s| s.to_str())
.unwrap_or("qwen3")
.to_string();
Ok(Qwen3GenerateModel {
chat_template,
tokenizer,
@@ -51,7 +55,7 @@ impl<'a> Qwen3GenerateModel<'a> {
eos_token_id1: generation_config.eos_token_id[0] as u32,
eos_token_id2: generation_config.eos_token_id[1] as u32,
generation_config,
model_name: "qwen3".to_string(),
model_name,
})
}
}