部署通一千问-Qwen-7B-Chat

2024-01-31  本文已影响0人  一个人一匹马

1、模型要求

2、conda创建环境

conda create -n qw python=3.10
conda activate qw

3、源码拉取及依赖安装

git clone https://github.com/QwenLM/Qwen
pip install -r requirements.txt
git clone -b v1.0.8 https://github.com/Dao-AILab/flash-attention
cd flash-attention && pip install .
# 下方安装可选,安装可能比较缓慢。
# pip install csrc/layer_norm
# pip install csrc/rotary

4、安装本地模型

cd Qwen
git clone https://www.modelscope.cn/qwen/Qwen-7B-Chat.git

5、修改openai_api.py的模型路径

6、安装openai_api.py需要的依赖

pip install fastapi uvicorn openai "pydantic>=2.3.0" sse_starlette

7、启动服务

python openai_api.py

8、集成到one api平台

9、集成到fastGPT平台

上一篇 下一篇

猜你喜欢

热点阅读