Commit 68fdcf98 authored by dcuai's avatar dcuai
Browse files

Update 24.04.1

parent 53dab2af
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
- [DISC-FinLLM: A Chinese Financial Large Language Model based on Multiple Experts Fine-tuning](https://arxiv.org/abs/2310.15205) - [DISC-FinLLM: A Chinese Financial Large Language Model based on Multiple Experts Fine-tuning](https://arxiv.org/abs/2310.15205)
## 模型结构 ## 模型结构
Baichuan-13B是由百川智能继Baichuan-7B之后开发的包含130亿参数模型,它在高质量的语料上训练了1.4万亿tokens,超过LLaMA-13B 40% DISC-FinLLM是基于我们构建的高质量金融数据集DISC-Fin-SFT在通用领域中文大模型Baichuan-13B-Chat上进行LoRA指令微调得到的金融大模型
Baichuan 2 是百川智能推出的新一代开源大语言模型,采用 2.6 万亿Tokens 的高质量语料训练。 Baichuan整体模型基于标准的Transformer结构
<div align="center"> <div align="center">
<img src="./images/transformer.jpg"/> <img src="./images/transformer.jpg"/>
</div> </div>
## 算法原理 ## 算法原理
DISC-FinLLM是基于我们构建的高质量金融数据集DISC-Fin-SFT在通用领域中文大模型Baichuan-13B-Chat上进行LoRA指令微调得到的金融大模型。 DISC-FinLLM是以Baichuan-13B 为基座模型,通过数据集的四个部分,分别训练 4 个 LoRA 专家模组,如图 14 所示。部署时,用户只需更换在当前基座上的 LoRA 参数就可以切换功能。因此用户能够根据使用需求激活 / 停用模型的不同模组,而无需重新加载整个模型。
<div align=center> <div align=center>
<img src="./images/transformer.png"/> <img src="./images/lora_en.png"/>
</div> </div>
...@@ -26,17 +26,15 @@ DISC-FinLLM是基于我们构建的高质量金融数据集DISC-Fin-SFT在通用 ...@@ -26,17 +26,15 @@ DISC-FinLLM是基于我们构建的高质量金融数据集DISC-Fin-SFT在通用
### Docker(方法一) ### Docker(方法一)
[光源](https://www.sourcefind.cn/#/service-details)拉取docker镜像的地址与使用步骤 [光源](https://www.sourcefind.cn/#/service-details)拉取docker镜像的地址与使用步骤
``` ```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu22.04-dtk23.10.1-py310 docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-ubuntu22.04-dtk24.04.1-py3.10
docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro --shm-size=64G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name DISC-FinLLM <your imageID> bash docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro --shm-size=64G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name DISC-FinLLM <your imageID> bash
cd /path/your_code_data/ cd /path/your_code_data/
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip install transformers=4.40.1
pip install bitsandbytes-0.43.0-py3-none-any.whl
pip install deepspeed-0.12.3+gitfe61783.abi0.dtk2310.torch2.1.0a0-cp310-cp310-manylinux2014_x86_64.whl
``` ```
### Dockerfile(方法二) ### Dockerfile(方法二)
...@@ -48,25 +46,21 @@ docker build --no-cache -t disc-finllm:latest . ...@@ -48,25 +46,21 @@ docker build --no-cache -t disc-finllm:latest .
docker run --shm-size=64G --name disc-finllm -v /opt/hyhal:/opt/hyhal:ro --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video -v /path/your_code_data/:/path/your_code_data/ -it disc-finllm:latest bash docker run --shm-size=64G --name disc-finllm -v /opt/hyhal:/opt/hyhal:ro --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video -v /path/your_code_data/:/path/your_code_data/ -it disc-finllm:latest bash
cd /path/your_code_data/ cd /path/your_code_data/
pip install transformers=4.40.1
pip install bitsandbytes-0.43.0-py3-none-any.whl
pip install deepspeed-0.12.3+gitfe61783.abi0.dtk2310.torch2.1.0a0-cp310-cp310-manylinux2014_x86_64.whl
``` ```
### Anaconda(方法三) ### Anaconda(方法三)
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。 关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。
``` ```
DTK驱动:dtk23.10 DTK驱动:dtk24.04.1
python:python3.10 python:python3.10
torch:2.1 torch:2.1
torchvision: 0.16.0 torchvision: 0.16.0
apex: 1.1.0 apex: 1.1.0
deepspped: 0.12.3 deepspped: 0.12.3
bitsandbytes: 0.43.0
``` ```
`Tips:以上dtk驱动、python、paddle等DCU相关工具版本需要严格一一对应` `Tips:以上dtk驱动、python、pytorch等DCU相关工具版本需要严格一一对应`
``` ```
conda create -n DISC-FinLLM python=3.10 conda create -n DISC-FinLLM python=3.10
...@@ -75,9 +69,7 @@ cd /path/your_code_data/ ...@@ -75,9 +69,7 @@ cd /path/your_code_data/
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple
pip install bitsandbytes-0.43.0-py3-none-any.whl pip install transformers=4.40.1
pip install deepspeed-0.12.3+gitfe61783.abi0.dtk2310.torch2.1.0a0-cp310-cp310-manylinux2014_x86_64.whl
``` ```
## 数据集 ## 数据集
......
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