1、实践流程
(1)使用Fastchat框架搭建运行ChatGLM模型openai兼容API
(2)测试AutoGen加载ChatGLM2
2、部署FastChat
2.1、创建虚拟环境
# Python version >= 3.8, < 3.12
conda create -n fastchat python=3.10 -y
conda activate fastchat
2.2、下载FastChat
git clone https://github.com/lm-sys/FastChat.git
2.3、依赖框架安装
pip3 install torch==2.0.0+cu117 torchvision==0.15.1+cu117 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu117
pip3 install cpm_kernels -i https://pypi.mirrors.ustc.edu.cn/simple --trusted-host=pypi.mirrors.ustc.edu.cn
pip3 install --upgrade pip -i https://pypi.mirrors.ustc.edu.cn/simple --trusted-host=pypi.mirrors.ustc.edu.cn
cd FastChat & pip3 install -e ".[model_worker,webui]" -i https://pypi.mirrors.ustc.edu.cn/simple --trusted-host=pypi.mirrors.ustc.edu.cn #这行根据自己的设置,或者用别的
2.4、加载模型
需要分别启动控制器、模型执行器和API服务。
# controller
cd FastChat
conda activate fastchat
python -m f

最低0.47元/天 解锁文章
1538

被折叠的 条评论
为什么被折叠?



