Commit 4ac43102 authored by zhaoying1's avatar zhaoying1
Browse files

Update README.md

parent 5b96615c
...@@ -39,7 +39,7 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk ...@@ -39,7 +39,7 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk
docker run -dit --network=host --name=chatglm --privileged --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size=16G --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root --ulimit stack=-1:-1 --ulimit memlock=-1:-1 image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04-py38-latest docker run -dit --network=host --name=chatglm --privileged --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size=16G --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root --ulimit stack=-1:-1 --ulimit memlock=-1:-1 image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.13.1-centos7.6-dtk-23.04-py38-latest
docker exec -it chatglm /bin/bash docker exec -it chatglm /bin/bash
pip install transformers==4.28.0 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com pip install transformers==4.28.0 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip install accelerate sentencepiece mdtex2html gradio rouge_chinese nltk jieba datasets protobuf peft -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com pip install accelerate sentencepiece mdtex2html gradio rouge_chinese nltk jieba datasets protobuf peft pydantic==1.10.9 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
``` ```
### Dockerfile(方式二) ### Dockerfile(方式二)
``` ```
...@@ -75,7 +75,7 @@ pip install -r requirements.txt ...@@ -75,7 +75,7 @@ pip install -r requirements.txt
│   ├── dev.json │   ├── dev.json
│   └── train.json │   └── train.json
``` ```
## 模型下载 ### 模型下载
Hugging Face模型下载地址: Hugging Face模型下载地址:
[ChatGLM-6B](https://huggingface.co/THUDM/chatglm-6b) [ChatGLM-6B](https://huggingface.co/THUDM/chatglm-6b)
...@@ -173,13 +173,13 @@ Hugging Face模型下载地址: ...@@ -173,13 +173,13 @@ Hugging Face模型下载地址:
python cli_demo.py python cli_demo.py
程序会在命令行中进行交互式的对话,在命令行中输入指示并回车即可生成回复,输入 clear 可以清空对话历史,输入 stop 终止程序。 程序会在命令行中进行交互式的对话,在命令行中输入指示并回车即可生成回复,输入 clear 可以清空对话历史,输入 stop 终止程序。
#### Results ## Results
- 推理效果如下: - 推理效果如下:
<div align="center"> <div align="center">
<img src="./ptuning/media/cli.png" width="650" height="100"> <img src="./ptuning/media/cli.png" width="650" height="100">
</div> </div>
## 重新 pretrain ### 重新 pretrain
由于当前的 [GLM-130B](https://github.com/THUDM/GLM-130B#news) 与 ChatGLM 的模型结构非常类似,所以对于有训练 GLM-130B 的用户来说,可以通过修改 ChatGLM 的 config.json 使用堆参数的方式将参数量达到130B。该项目为了满足用户对 ChatGLM 重新 pretrain 的需求,继续添加了 simple-pretrain 目录,旨在提供一种改动最小的 pretrain 示例。pretrain步骤如下: 由于当前的 [GLM-130B](https://github.com/THUDM/GLM-130B#news) 与 ChatGLM 的模型结构非常类似,所以对于有训练 GLM-130B 的用户来说,可以通过修改 ChatGLM 的 config.json 使用堆参数的方式将参数量达到130B。该项目为了满足用户对 ChatGLM 重新 pretrain 的需求,继续添加了 simple-pretrain 目录,旨在提供一种改动最小的 pretrain 示例。pretrain步骤如下:
...@@ -195,7 +195,7 @@ Hugging Face模型下载地址: ...@@ -195,7 +195,7 @@ Hugging Face模型下载地址:
说明:convert.py 可以将原始的txt数据转换成 chatglm 可用的 json 形式的数据集格式。该示例使用指环王1书籍作为预训练数据集。 说明:convert.py 可以将原始的txt数据转换成 chatglm 可用的 json 形式的数据集格式。该示例使用指环王1书籍作为预训练数据集。
### 实验设置 #### 实验设置
``` ```
LR=1e-5 LR=1e-5
...@@ -225,7 +225,7 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma ...@@ -225,7 +225,7 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma
--fp16 --fp16
``` ```
### 训练loss收敛情况 #### 精度
由于该示例预训练数据集较小,loss会降的至较低水平到0.1左右。 由于该示例预训练数据集较小,loss会降的至较低水平到0.1左右。
<div align="center"> <div align="center">
...@@ -233,7 +233,7 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma ...@@ -233,7 +233,7 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma
</div> </div>
## 强化学习(RLHF)微调方案 ### 强化学习(RLHF)微调方案
目前在 DCU 上 ChatGLM 使用强化学习微调有两种方案可以走通: 目前在 DCU 上 ChatGLM 使用强化学习微调有两种方案可以走通:
...@@ -242,20 +242,20 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma ...@@ -242,20 +242,20 @@ HIP_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus=4 --master_port $MASTER_PORT ma
## 应用场景 ## 应用场景
### 算法类别 ### 算法类别
`自然语言处理` `对话问答`
### 热点应用行业 ### 热点应用行业
`nlp,智能聊天助手,科研` `医疗,教育,科研,金融`
## 源码仓库及问题反馈 ## 源码仓库及问题反馈
- https://developer.hpccube.com/codes/modelzoo/chatglm - https://developer.hpccube.com/codes/modelzoo/chatglm
## 参考 ## 参考资料
- [THUDM/ChatGLM-6B](https://github.com/THUDM/ChatGLM-6B/tree/main) - [THUDM/ChatGLM-6B](https://github.com/THUDM/ChatGLM-6B/tree/main)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment