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

相关推荐
头茬韭菜8 小时前
Kronos 模型推理性能基准测试报告
llama
染指111013 小时前
61.RAG-RAG存在的问题
人工智能·llama·rag·llama_index·llamaindex
云卷云舒___________3 天前
DeepSeek V4灰度测试、马斯克Grok 4.6下周开测、上海AI实验室Intern-S2击败Opus4.8 | 7月18日 AI日报
ai·qwen·opus·grok·deepseek·ai日报·interns2
CClaris5 天前
大模型量化从0到1(九):用 llama.cpp 把模型转成 GGUF 并跑本地推理
人工智能·pytorch·python·深度学习·llama
染指11105 天前
56.llama_index-查询引擎
人工智能·llama·rag·llama_index·llamaindex
_codemonster5 天前
从零手搓大模型(七)GPT 转 Llama:从教学版 GPT 走向现代 LLM 架构
人工智能·gpt·大模型·llama
Briwisdom6 天前
Speculative Decoding:用小模型给大模型“打草稿“,推理加速 2-3×
模型部署·vllm·eagle·llama.cpp·prefill·speculative·decoding
SLD_Allen6 天前
Purple Llama:Meta开源的LLM安全“紫队”工具箱
安全·开源·llama
俊俊谢7 天前
从零搭建:本地LangChain Agent调用远程LLaMA-Factory模型服务
langchain·llama
liming4957 天前
Ubuntu + Docker + NVIDIA 显卡 上部署 Ollama
llama