部署大模型

一:原模型

1.下载ollama

2.下载模型

复制代码
ollama run qwen2.5:7b-instruct   # 下载完就运行(终端对话)

# ollama run qwen2.5:7b-instruct-q4_K_M  
# 更小的量化模型

3.后续启动

复制代码
ollama run qwen2.5:7b-instruct

补充:在ollama图形界面部署,点击"+",找到模型下载路径

二:微调后的大模型

1.合并

lora权重+底座模型

复制代码
llamafactory-cli export \
--model_name_or_path /mnt/c/Users/hsp/.cache/modelscope/hub/models/Qwen/Qwen2.5-7B-Instruct \
--model_type qwen2 \
--template qwen \
--finetuning_type lora \
--lora_dir ./lora_qwen \
--export_dir ./full_model    # 完整模型

2.Ollama 只认 GGUF

工具

复制代码
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make

转gguf

复制代码
python convert-hf-to-gguf.py ../full_model --outtype q4_K_M --outfile qwen2.5-finetuned.gguf

创建模型

复制代码
ollama create qwen2.5-mymodel -f- <<EOF
FROM qwen2.5-finetuned.gguf
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
{{ .Response }}<|im_end|>"""
PARAMETER temperature 0.7
PARAMETER num_ctx 8192
EOF

部署

复制代码
ollama run qwen2.5-mymodel

三:删除模型

ollama

复制代码
ollama list

ollama rm qwen2.5:7b-instruct

modelscop

复制代码
rmdir /s /q C:\Users\hsp\.cache\modelscope  # 所有模型

modelscope clear-cache --model Qwen/Qwen2.5-7B-Instruct

rm -rf ~/.cache/modelscope   # 缓存
相关推荐
张较瘦_2 分钟前
[论文阅读] 人工智能 + 软件开发 | 本地 LLM 编程能力 “大摸底”:8 个模型挑战 3589 道 Kattis 题,差距竟这么大!
论文阅读·人工智能
张较瘦_2 分钟前
[论文阅读] AI + 软件工程 | 告别意图丢失!基于算法的LLM代码翻译新范式来了
论文阅读·人工智能·软件工程
千桐科技8 分钟前
qKnow 智能体构建平台知识图谱能力优化:围绕图谱探索、知识库、数据源、知识推理、知识融合与概念属性的完善升级
人工智能·大模型·知识图谱·agent·rag·qknow·智能体构建平台
tzc_fly15 分钟前
LLaDA2.0:块扩散语言模型
人工智能·语言模型·自然语言处理
Forrit21 分钟前
DPO 完整评估指标体系
人工智能
程序员cxuan25 分钟前
看了一下姚顺宇的访谈,确实太顶了。
人工智能·后端·程序员
心疼你的一切26 分钟前
PyTorch实战:手写数字识别神经网络
人工智能·pytorch·深度学习·神经网络·机器学习
weixin_4577600027 分钟前
基于 YOLO11-OBB 与 LPRNet ONNX 的车牌定位识别桌面系统实践
人工智能·python·车牌识别·yolo11
Autumn_ing27 分钟前
2026实测:这5款AI生成UI工具支持Shadcn UI/Ant Design组件库
人工智能·ui·设计模式·aigc·设计规范
Mike_66629 分钟前
摩尔线程AB100安装torch环境
人工智能·深度学习·ffmpeg·aarch64·摩尔线程·musa