登录colab

创建新的notebook

选择notebook设置

选择GPU然后保存,需要选择GPU

克隆代码
!git clone https://github.com/THUDM/ChatGLM-6B.git

切换到目录安装所需要的依赖
%cd /content/ChatGLM-6B
%pwd
!pip install -r requirements.txt


安装所需要的依赖包


修改web_demo.py

修改前
修改后

share修改为True,默认False,要不然没法访问

运行脚本
!python web_demo.py


!pip uninstall gradio
!pip install gradio==3.50.0


访问公网地址

页面报错了

换成old试试,也需要和之前的一样修改代码然后执行





















