SafeTensors:
为了安全,不包含任何执行代码,由hugging face设计,不可以量化,根据文件头部索引可快速查找对应数据,实现零拷贝,适用微调,开发
GGUF
打包后的单文件,可以在有限资源设备上使用,可以量化,适用本地小设备推理
可以使用格式转换(正向:PyTorch/SafeTensors → GGUF):
python convert_hf_to_gguf.py ./model_dir —outfile model.gguf
比如将modelscope下载的Qwen3.5-0.8b的SafeTensors转为guff格式
python convert_hf_to_gguf.py C:\Users\Administrator\.cache\modelscope\hub\models\Qwen\Qwen3___5-0___8B --outfile E:\models2026\Qwen3.5-0.8B.gguf --outtype f16
执行结果:
