基于揽睿星舟平台实现
邀请链接揽睿星舟
平台主要可以使用HF下载加速
配置
- GPU:NVIDIA 3090 24G
- CPU: Intel Xeon(Icelake) 2.6GHz, 12 Core
- 内存: 40G
- 系统盘 :150G
- 浮点算力:35.6 TFLOPS
镜像准备
- 实例名称:chatglm(自定义)
- 镜像: pytorch2.0+cuda11.7
- 其他 :挂载网盘,不使用数据盘
部署
1.创建镜像,等待启动。
2.选择刚才创建的镜像,进入Vs Code
3.克隆chatGLM3-6B
设置加速
export http_proxy=http://172.22.96.4:10800 && export https_proxy=http://172.22.96.4:10800
国内镜像gitcode镜像仓库
git clone https://gitcode.net/Harvey_JH/ChatGLM3.git
cd ChatGLM3
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
python3 -m streamlit run web_demo2.py --server.port 27777
开始下载模型
说明:27777为揽睿工作空间映射公网连接的端口
4.复制调试链接 打开网址
我是分割线--------------------------------------------------------------------------------------------------------------------------
本地复现
模型位置:https://huggingface.co/THUDM/chatglm3-6b/tree/main
百度网盘:https://pan.baidu.com/s/1f64s67CCNu-FOmI0KyEmYw?pwd=13BC
下载源码至本地,VS Code 打开
gitcode镜像:https://gitcode.net/Harvey_JH/ChatGLM3
- 终端–新建终端
#安装依赖-此处使用清华源加速
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
2.修改web_demo2.py中model_path
# 设置为模型ID或本地文件夹路径
model_path = "E:\\chatglm3-6b-32k"
3.启动web_demo2.py
python -m streamlit run web_demo2.py
4.验证
PS: 首次加载网页需要加载模型
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:49<00:00, 7.03s/it]
写在最后
欢迎移步我的Github仓库,https://github.com/Jun-Howie/erniebot-openai-api
本仓库使用飞桨星河社区接入ernie-4.0联网功能,如果你需要可以Fork我的仓库,还请给个Star让我知道