Datawhale-部署ChatGLM3-6B模型
- 创建项目
无脑跟着飞书的教程走就可以了,教程图文并茂还是很详细的
ps:抓个bug,ChtaGLM3-6B -> ChatGLM3-6B
- 配置环境+修改代码
所需的指令方便大家复制
tmux
apt-get update && apt-get install unzip
git config --global url."https://gitclone.com/".insteadOf https://
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple
pip config set globat.trusted-host mirrors.ustc.edu.cn
python3 -m pip install --upgrade pip
git clone https://github.com/THUDM/ChatGLM3.git
cd ChatGLM3
pip install -r requirements.txt # 安装依赖包
接着修改一下web_demo.py****和web_demo2.py,相当于设置一下内网端口,然后在右侧的控制台将内网端口转发出去
运行代码
可以适当地将max_length调小一点,速度会快很多,这样就可以愉快地玩耍了
python web_demo.py # 运行 demo 1
streamlit run web_demo2.py # 运行 demo 2