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

相关推荐
ECHO飞跃 0122 天前
Unity2019 本地推理 通义千问0.5-1.5B微调导入
人工智能·深度学习·unity·llama
黑白极客2 天前
ACP大模型认证刷题工具开源,助力高效备考
java·ai·github·llama·认证
迷之程序员2 天前
llama-cpp-python用法,模型加载gpu踩坑全记录
开发语言·python·llama
loong_XL3 天前
qwen3.5 文字、图像、视频多模态openai接口案例
音视频·qwen·多模态大模型
~kiss~3 天前
Ollama 底层的 llama.cpp 和 GGUF
llama
小雨中_4 天前
4.1 Megatron-LM:千卡级集群预训练的“硬核”框架
人工智能·python·深度学习·机器学习·llama
重生之我要成为代码大佬5 天前
AI框架设计与选型
人工智能·langchain·大模型·llama·qwen
小雨中_5 天前
4.1 LLaMA 系列:从 LLaMA-1 到 LLaMA-3
人工智能·python·深度学习·机器学习·自然语言处理·llama
l1t7 天前
DeepSeek总结的llama.cpp使用说明
llama
XLYcmy7 天前
智能体大赛 总结与展望 比赛总结
大数据·ai·llm·prompt·agent·qwen·万方数据库