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

相关推荐
Java后端的Ai之路2 天前
【大模型技术栈】-Qwen与DeepSeek如何构建智能大脑?
大模型·qwen·deepseek
Android小码家2 天前
llama.cpp+Android应用定制
android·llama
Android小码家2 天前
WSL+llama+CPU本地模型部署
llama·wsl·模型
沛沛老爹2 天前
Web开发者5分钟上手:Agent Skills环境搭建与基础使用实战
java·人工智能·llm·llama·rag·agent skills
星辰引路-Lefan2 天前
在浏览器中运行大模型:基于 WebGPU 的本地 LLM 应用深度解析
ai·ai编程·llama·gpu算力
natide3 天前
text-generateion-webui模型加载器(Model Loaders)选项
人工智能·llama
*星星之火*3 天前
【大模型进阶】视频课程2 LORA微调原理深度解析+LLaMA Factory实操指南:小白也能玩转大模型定制
lora·大模型·微调·llama·llama factory
leida_wt3 天前
新版llama.cpp在win7系统的移植与编译
编译·llama.cpp·win7
natide4 天前
Llama2 API部署错误调试
fastapi·llama
沛沛老爹4 天前
用 Web 开发思维理解 Agent 的三大支柱——Tools + Memory + LLM
java·人工智能·llm·llama·rag