2026-07-08 10:44:32 +08:00
|
|
|
use minicpm_convert::export_model_q8;
|
2026-07-01 14:33:28 +08:00
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
|
|
|
let safetensors_path = Path::new("MiniCPM5-1B/model-00000-of-00001.safetensors");
|
|
|
|
|
let config_path = Path::new("MiniCPM5-1B/config.json");
|
|
|
|
|
let tokenizer_path = Path::new("MiniCPM5-1B/tokenizer.json");
|
|
|
|
|
|
2026-07-08 10:44:32 +08:00
|
|
|
// Q8 量化导出(INT8,文件约 1/4 大小)
|
|
|
|
|
export_model_q8(safetensors_path, config_path, tokenizer_path, Path::new("model_q8"))?;
|
2026-07-01 14:33:28 +08:00
|
|
|
|
|
|
|
|
println!("模型转换完成!");
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|