赞
踩
此文章主要介绍使用 使用 vllm 本地部署 Qwen2-7B-Instruct。
conda create -n myvllm python=3.11 -y
conda activate myvllm
pip install -U pip
安装 Ray 和 Vllm,
pip install ray
安装 Vllm,
# pip install vllm
git clone https://github.com/vllm-project/vllm.git; cd vllm
pip install ./ --no-build-isolation
安装 flash-attention,
# git clone https://github.com/Dao-AILab/flash-attention;cd flash-attention
# pip install ./ --no-build-isolation
pip install flash-attn
eval "$(conda shell.bash hook)"
conda activate myvllm
CUDA_VISIBLE_DEVICES=3,2,1,0
python -m vllm.entrypoints.openai.api_server --trust-remote-code --served-model-name gpt-4 --model Qwen/Qwen2-7B-Instruct --gpu-memory-utilization 0.98 --tensor-parallel-size 4 --port 8000
完结!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。