api-for-open-llm对接CodeGeex2部署流程

使用api-for-open-llm对接CodeGeex2,提供OpenAI接口,部署流程

流程记录

1、环境

阿里云GPU主机,GPU是A10、24G显存

2、涉及到的资源

1、CodeGeex2,参数文件,可以在国内镜像网站下载
2、api-for-open-llm,https://github.com/xusenlinzy/api-for-open-llm

3、本地部署流程

建立conda环境:
1、 conda create -n openAI python=3.10
2、 conda activate openAI
clone项目、安装依赖,阿里云里的cuda版本是11.8,安装的torch要适配
3、 git clone https://github.com/xusenlinzy/api-for-open-llm.git
4、 pip install torch2.0.0 torchvision0.15.1 torchaudio2.0.1 --index-url https://download.pytorch.org/whl/cu118
5、 pip install -r requirements.txt
6、 进入目录,cp .env.example .env,
我只修改两项
MODEL_NAME=codegeex2-6b
MODEL_PATH=/mnt/workspace/model/codegeex2-6b
7、启动
cp api/server.py .
python server.py
报错:AttributeError: ‘ChatGLMTokenizer’ object has no attribute ‘tokenizer’. Did you mean: ‘tokenize’?
降低 transformers 版本就可以跑起来了
pip uninstall transformers
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple transformers
4.33.2

8、测试,http://ip:8000/v1/models (我做的内网穿透,ip是代理地址)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值