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

相关推荐
jjinl13 小时前
1.1 llama.cpp 编译
llama
serve the people13 小时前
macbook m4 LLaMA-Factory入门级微调
llama
WiSirius2 天前
LLM:基于 AgentScope + Streamlit 的 AI Agent脑暴室
人工智能·深度学习·自然语言处理·大模型·llama
掘金安东尼2 天前
llama.cpp、Ollama、LM Studio:背后是谁在做?为什么会出现?要什么机器才能跑?
llama
海天一色y2 天前
LLaMA-Factory PPO 训练实战:从 SFT 到 RLHF 完整指南
llama
小田学Python2 天前
Dify+Ollama模型搭建攻略:本地环境实战指南
大模型·qwen·dify·ollama
接着奏乐接着舞。2 天前
5分钟本地跑起大模型
人工智能·llama
liuze4083 天前
Ollama安装
llama
小超同学你好3 天前
Transformer 14. DeepSeekMoE 架构解析:与 LLaMA 以及 Transformer 架构对比
语言模型·架构·transformer·llama
小超同学你好3 天前
Transformer 15: DeepSeek-V2 架构解析:MLA + DeepSeekMoE 与主流架构对比
语言模型·架构·transformer·llama