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

相关推荐
ONE_SIX_MIX3 小时前
新版本 llama-cpp 构建/下载 webui 导致build 失败 解决
llama
Wanderer X3 小时前
【LLM】LLaMA
llama
落痕的寒假3 小时前
[深度学习] 大模型学习8上-推理部署框架llama.cpp与Ollama使用指北
深度学习·学习·llama
曦云沐5 小时前
MacOS 上使用 Metal GPU 加速编译 llama.cpp 完整指南
macos·llama.cpp
网络工程小王1 天前
【大模型vLLM 使用】学习笔记
笔记·学习·llama
TGITCIC2 天前
大模型训练师的炼丹之道 (1)-最新版llama-factory环境搭建和全排错
微调·sft·llama·模型训练·训练·大模型训练·llama-factory
周公2 天前
记一次在双 RTX 3090 工作站上部署 vLLM 与 Qwen3.6-35B-AWQ 的实战记录
python·ai·llama·vllm·ollama
若苗瞬2 天前
记一次失败的本地部署 LLM MTP 模型的过程
llm·llama·cpp·gemma·mtp·ik_llama·dflash
进击切图仔2 天前
微调 qwen 时候踩坑记录
torch·tensorrt·qwen
黑贝是条狗5 天前
llama编译封装了一个最小翻译模型400M
llama