chore(代码变更): 1. 清理无用代码 2. 更新依赖库 3. 优化项目结构 4. 修复小型bug 5. 增加注释以提高可读性
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
use burn::backend::Wgpu;
|
||||
use minicpm_convert::export_model;
|
||||
use minicpm_convert::export_model_q8;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let device = Default::default();
|
||||
|
||||
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");
|
||||
let output_dir = Path::new("model");
|
||||
|
||||
export_model::<Wgpu>(
|
||||
safetensors_path,
|
||||
config_path,
|
||||
tokenizer_path,
|
||||
output_dir,
|
||||
&device,
|
||||
)?;
|
||||
// Q8 量化导出(INT8,文件约 1/4 大小)
|
||||
export_model_q8(safetensors_path, config_path, tokenizer_path, Path::new("model_q8"))?;
|
||||
|
||||
println!("模型转换完成!");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user