Files
MiniCPM5-1B-rust/examples/convert/src/main.rs
T

15 lines
508 B
Rust

use minicpm_convert::export_model_q8;
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");
// Q8 量化导出(INT8,文件约 1/4 大小)
export_model_q8(safetensors_path, config_path, tokenizer_path, Path::new("model_q8"))?;
println!("模型转换完成!");
Ok(())
}