本文主要对 ChatGLM2-6B 模型的部署和推理过程进行介绍。
一、部署环境
在阿里云服务器上部署,具体环境如下:
modelscope:1.9.5
pytorch 2.0.1
tensorflow 2.13.0
python 3.8
cuda 118
ubuntu 20.04
CPU 8 core
内存 30 GiB
GPU NVIDIA A10 24GB
二、部署步骤
(1)下载 ChatGLM2-6B 运行代码。
git clone https://github.com/THUDM/ChatGLM2-6B.git
(2) 安装依赖环境
进入 ChatGLM2-6B 目录,执行如下命令安装依赖。
pip install -r requirements.txt
(3)修改 cli_demo.py
直接运行会出现如下错误。
ChatGLM:2024-06-20 22:18:27.454216: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONE