mobile wallpaper 1
100 字
1 分钟
Qwen2.5-7B-Instruct 部署
2026-06-10
无标签

使用集群#

NVIDIA GeForce RTX 3090 8x

  • GPU memory:24GB per GPU
  • NVIDIA Driver Version:530.30.02
  • CUDA Version:12.1

创建环境#

Python Version:3.10

conda create -p /data/<username>/envs/qwen python=3.10 -y
conda activate /data/<username>/envs/qwen

安装依赖#

安装 PyTorch、vLLM 及相关依赖:

pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
--index-url https://download.pytorch.org/whl/cu121
pip install vllm==0.6.6.post1 \
-i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -U huggingface_hub \
-i https://pypi.tuna.tsinghua.edu.cn/simple

较新版本的 transformers 依赖更高版本的 PyTorch dtype 支持,因此回退到兼容版本:

pip uninstall -y transformers tokenizers
pip install transformers==4.45.2 tokenizers==0.20.3 \
-i https://pypi.tuna.tsinghua.edu.cn/simple

下载模型#

export HF_ENDPOINT=https://hf-mirror.com
hf download Qwen/Qwen2.5-7B-Instruct \
--local-dir /data/<username>/models/Qwen2.5-7B-Instruct

模型部署#

export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1

2 张 GPU 并行:

CUDA_VISIBLE_DEVICES=0,1 vllm serve \
/data/<username>/models/Qwen2.5-7B-Instruct \
--host 0.0.0.0 \
--port 8002 \
--served-model-name chat-model \
--tensor-parallel-size 2

测试模型#

curl http://127.0.0.1:8002/v1/models
curl http://127.0.0.1:8002/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"chat-model",
"messages":[
{
"role":"user",
"content":"介绍一下后训练中的GRPO算法"
}
]
}'

最终效果如下: Image2

分享

如果这篇文章对你有帮助,欢迎分享给更多人!

Qwen2.5-7B-Instruct 部署
https://kisaragi-irona.top/posts/project/qwen25-7b-instruct/blog/
作者
Kisaragi
发布于
2026-06-10
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时

目录