llama.cpp运行qwen0.5B

编译llama.cp

参考

下载模型

05b模型下载

转化模型

创建虚拟环境

bash 复制代码
conda create --prefix=D:\miniconda3\envs\llamacpp python=3.10
conda activate D:\miniconda3\envs\llamacpp

安装所需要的包

bash 复制代码
cd G:\Cpp\llama.cpp-master
pip install -r requirements.txt
python convert.py -h



执行转换命令

bash 复制代码
python convert.py G:\Python\Qwen1.5-0.5B-Chat --outfile G:\Cpp\qwenchat0.5b.gguf --outtype q8_0
python convert-hf-to-gguf.py G:\Python\Qwen1.5-0.5B-Chat  --outfile G:\Cpp\qwenchat0.5b.gguf
# 解释
# python 
# convert.py # convert.py路径
# /content/finetuned-2_merged # 模型路径
# --outfile finetuned-2.gguf # 要分配的gguf模型名称
# --outtype q8_0 #以8 Bit量化



将模型量化为5Bit(使用q5_k-m方法)

bash 复制代码
quantize.exe G:\Cpp\qwenchat0.5b.gguf qwenchat0.5b-q5_k_m.gguf q5_k_m


运行

bash 复制代码
# 注意Qwen模型要使用chatml prompt 模版
main.exe -m qwenchat0.5b-q5_k_m.gguf -n 512 --chatml

尝鲜通义千问1.8B
参考
hf2gguf

相关推荐
charlee443 天前
在本地部署Qwen大语言模型全过程总结
大模型·cuda·qwen·量化
m0_603888715 天前
LLaMA-Adapter V2 Parameter-Efficient Visual Instruction Model
人工智能·深度学习·ai·llama·论文速览
Jeremy_lf6 天前
阿里巴巴开源多模态大模型-Qwen-VL系列论文精读(一)
大模型·qwen·多模态大模型·mllm
三千院本院9 天前
LlaMA_Factory实战微调VL大模型
llama
爱分享的飘哥14 天前
第四十六章:AI的“瞬时记忆”与“高效聚焦”:llama.cpp的KV Cache与Attention机制
llama·llama.cpp·kv cache·attention优化·llm cpu推理·量化attention·gguf推理
psyq15 天前
LLaMA Factory 角色扮演模型微调实践记录
人工智能·llama
带电的小王16 天前
Windows中使用Qwen模型:VSCode+Cline
ide·vscode·ai编程·qwen
张成AI18 天前
Qwen3-30B-A3B-Thinking-2507 推理模型深度评测
人工智能·qwen
liliangcsdn23 天前
mac测试ollama llamaindex
数据仓库·人工智能·prompt·llama
茫茫人海一粒沙23 天前
使用 LLaMA 3 8B 微调一个 Reward Model:从入门到实践
llama