部署大模型

一:原模型

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   # 缓存
相关推荐
回眸&啤酒鸭19 小时前
【回眸】Minicart 电商购物车核心功能落地指南
人工智能
一隅论数智19 小时前
给AI一张“业务概念地图“:本体如何从哲学走向企业智能
大数据·人工智能·经验分享·笔记·学习·学习方法·政务
AI的探索之旅19 小时前
97 个 OpenCV 实例(三十):双目立体,从标定到点云
人工智能·opencv·计算机视觉
AlbertZein19 小时前
Step-5-Preview 上手实测:3D 游戏、金融分析、网页设计一次跑完
人工智能·aigc
LaughingZhu20 小时前
Product Hunt 每日热榜 | 2026-09-19
人工智能·深度学习·神经网络·搜索引擎·百度
美狐美颜SDK开放平台20 小时前
开发直播APP时如何接入视频美颜SDK?开发流程与注意事项
android·人工智能·计算机视觉·音视频·直播美颜sdk
wukangjupingbb20 小时前
智能网联汽车安全能力框架
人工智能
龙亘川21 小时前
明月照湾区,智启新赛道:从顶流文旅IP盛会看智慧文旅升级路径
人工智能·智慧城市·开源软件·数据可视化
飞猫的边缘AI21 小时前
边缘AI应用:家用AI摄像头怎么做数据训练?
人工智能·边缘计算·ai算法·边缘ai