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

相关推荐
blackoon881 天前
DeepSeek R1大模型微调实战-llama-factory的模型下载与训练
llama
johnny2331 天前
大模型微调理论、实战:LLaMA-Factory、Unsloth
llama
闲看云起1 天前
从 GPT 到 LLaMA:解密 LLM 的核心架构——Decoder-Only 模型
gpt·架构·llama
小草cys3 天前
在树莓派集群上部署 Distributed Llama (Qwen 3 14B) 详细指南
python·llama·树莓派·qwen
咕咚-萌西3 天前
联邦学习论文分享:Towards Building the Federated GPT:Federated Instruction Tuning
llama·联邦学习·指令微调
relis4 天前
解密llama.cpp中的batch与ubatch:深度学习推理优化的内存艺术
深度学习·batch·llama
relis4 天前
解密llama.cpp:Prompt Processing如何实现高效推理?
prompt·llama
GEO_JYB5 天前
BERT家族进化史:从BERT到LLaMA,每一次飞跃都源于对“学习”的更深理解
学习·bert·llama
AI大模型6 天前
大模型开发实战:使用 LLaMA Factory 微调与量化模型并部署至 Ollama
程序员·llm·llama
relis6 天前
解密llama.cpp:从Prompt到Response的完整技术流程剖析
prompt·llama