Skip to content

Commit 6e41d25

Browse files
committed
update version v1.1
1 parent 4cdc2e5 commit 6e41d25

File tree

4 files changed

+58
-25
lines changed

4 files changed

+58
-25
lines changed

README.md

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@
2727

2828
<img src="assets/chatflow.jpg" width=90% align=center />
2929

30-
[中文预训练语料](corpus/README.md) | [中文指令精调数据集](instructions/README.md) | [模型量化部署](https://github.com/fengyh3/llama_inference) | [领域微调示例](#todo-list)
30+
[中文预训练语料](corpus/README.md) | [中文指令精调数据集](instructions/README.md) | [模型量化部署](https://github.com/ProjectD-AI/llama_inference) | [领域微调示例](https://github.com/ProjectD-AI/domain-chatflow)
3131

3232
## News
3333

34-
+ **[2023/4/27]** 🚀 正式发布 Linly-ChatFlow-13B 对话模型、Linly-Chinese-LLaMA-33B 中文基础模型
34+
+ **[2023/5/14]** 🚀 更新 v1.1 版,使用更多训练数据,ChatFlow 序列长度提升至1024,提供在线试用和 API 接口
3535

36-
+ **[2023/4/17]** [llama_inference](https://github.com/fengyh3/llama_inference) 更新 8-bit 量化推理和微服务部署,大幅度提升推理速度并降低内存消耗
36+
+ **[2023/4/27]** 正式发布 Linly-ChatFlow-13B 对话模型、Linly-Chinese-LLaMA-33B 中文基础模型
37+
38+
+ **[2023/4/17]** [llama_inference](https://github.com/ProjectD-AI/llama_inference) 更新 8-bit 量化推理和微服务部署,大幅度提升推理速度并降低内存消耗
3739

3840
+ **[2023/4/8]** [TencentPretrain](https://github.com/Tencent/TencentPretrain) 现已支持 LoRA 训练和 DeepSpeed Zero-3 Offload 流水线并行
3941

@@ -65,16 +67,14 @@
6567
请确认在已[获得许可](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform?usp=send_form)的前提下使用本仓库中的模型。
6668

6769

68-
**7B**[基础模型 Linly-Chinese-LLaMA-7B](https://huggingface.co/P01son/Linly-Chinese-LLaMA-7B/)[对话模型 Linly-ChatFlow-7B](https://huggingface.co/P01son/Linly-ChatFlow-7B)[int4量化版本 Linly-ChatFlow](https://huggingface.co/P01son/Linly-ChatFlow-7B-int4)
69-
**13B**[基础模型 Linly-Chinese-LLaMA-13B](https://huggingface.co/P01son/Linly-Chinese-LLaMA-13B)[对话模型 Linly-ChatFlow-13B🔥](https://huggingface.co/P01son/Linly-ChatFlow-13B/)
70-
**33B**[33B 基础模型](https://huggingface.co/P01son/Linly-Chinese-LLaMA-33b-hf)
70+
**7B**[基础模型 Chinese-LLaMA-7B](https://huggingface.co/Linly-AI/Chinese-LLaMA-7B/)[对话模型 ChatFlow-7B](https://huggingface.co/Linly-AI/ChatFlow-7B)
71+
**13B**[基础模型 Chinese-LLaMA-13B](https://huggingface.co/Linly-AI/Chinese-LLaMA-13B)[对话模型 ChatFlow-13B🔥](https://huggingface.co/Linly-AI/ChatFlow-13B)
72+
**33B**[基础模型 Chinese-LLaMA-33B (hf格式)](https://huggingface.co/P01son/Linly-Chinese-LLaMA-33b-hf)
7173
**65B**:训练中
7274

7375

7476
🤗 **HuggingFace模型**
75-
[7B 基础模型](https://huggingface.co/P01son/Linly-Chinese-LLaMA-7b-hf) | [13B 基础模型](https://huggingface.co/P01son/Linly-Chinese-LLaMA-13b-hf)[33B 基础模型](https://huggingface.co/P01son/Linly-Chinese-LLaMA-33b-hf)
76-
[7B 对话模型](https://huggingface.co/P01son/Linly-ChatFlow-7b-hf) | [13B 对话模型](https://huggingface.co/P01son/Linly-ChatFlow-13b-hf)
77-
77+
项目中提供 [转换脚本](./scripts/convert_llama_from_tencentpretrain_to_hf.py),支持 TencentPretrain 格式与 Huggingface 格式互转
7878

7979
### 训练情况
8080

@@ -84,59 +84,73 @@
8484
</center>
8585

8686

87-
### 在线试用demo
88-
非常感谢huggingface提供了A10G让我们构建在线demo,可以访问[Linly-ChatFlow](https://huggingface.co/spaces/Linly-AI/Linly-ChatFlow)进行体验。同时也可以在huggingface的Community中对我们的项目提出改进的建议或者上传有趣的问答结果,促进Linly模型的发展。
87+
### 在线试用
88+
89+
在线 demo 可以访问 [Linly-ChatFlow](https://huggingface.co/spaces/Linly-AI/Linly-ChatFlow) 体验
90+
91+
<img src="assets/huggingface_demo.jpg"/>
92+
93+
在线 API server 试用:
94+
95+
```bash
96+
curl -H 'Content-Type: application/json' https://P01son-xxl1dlv7o2tb.serv-c1.openbayes.net -d '{"question": "北京有什么好玩的地方?"}'
97+
```
8998

90-
<img src="assets/huggingface_demo.jpg"/>
99+
感谢 [HuggingFace](https://huggingface.co/)[OpenBayes](https://openbayes.com/) 提供用于在线体验的计算资源。
91100

92-
如果想在自己的环境上构造交互式demo,欢迎关注和star项目:[llama_inference](https://github.com/fengyh3/llama_inference)
101+
![](assets/sponsors/logo-1.png)
102+
![](assets/sponsors/logo-2.png)
103+
104+
105+
106+
如果想在自己的环境上构造交互式demo,欢迎关注和star项目:[llama_inference](https://github.com/ProjectD-AI/llama_inference)
93107

94108

95109
## 快速开始
96110

97111
下载预训练 ChatLLaMA 权重,安装依赖,测试环境: py3.8.12 cuda11.2.2 cudnn8.1.1.33-1 torch1.9.0 bitsandbytes0.37.2
98112

99-
**解码参数及详细使用说明请参考 [llama_inference](https://github.com/fengyh3/llama_inference)**
113+
**解码参数及详细使用说明请参考 [llama_inference](https://github.com/ProjectD-AI/llama_inference)**
100114

101115
```bash
102116
git lfs install
103-
git clone https://huggingface.co/P01son/Linly-ChatFlow-7B
104-
git clone https://github.com/fengyh3/llama_inference.git
117+
git clone https://huggingface.co/Linly-AI/ChatFlow-7B
118+
git clone https://github.com/ProjectD-AI/llama_inference
105119

106120
cd llama_inference
107121
vi beginning.txt #编辑用户输入,例如"上海有什么好玩的地方?"
108122

109123
python3 llama_infer.py --test_path prompts.txt --prediction_path result.txt \
110-
--load_model_path ../Linly-ChatFlow-7B/chatflow_7b.bin \
124+
--load_model_path ../ChatFlow-7B/chatflow_7b.bin \
111125
--config_path config/llama_7b_config.json \
112-
--spm_model_path ../Linly-ChatFlow-7B/tokenizer.model --seq_length 512
126+
--spm_model_path ../ChatFlow-7B/tokenizer.model --seq_length 512
113127
```
114128

115129
### 多轮对话
116130

117131
```bash
118132
python3 llama_dialogue.py --seq_length 512 --top_k 10 \
119-
--load_model_path ../Linly-ChatFlow-7B/chatflow_7b.bin \
133+
--load_model_path ../ChatFlow-7B/chatflow_7b.bin \
120134
--config_path ./config/llama_7b_config.json \
121-
--spm_model_path ../Linly-ChatFlow-7B/tokenizer.model
135+
--spm_model_path ../ChatFlow-7B/tokenizer.model
122136
```
123137

124138
### Int8 推理加速
125139

126140
```bash
127141
python3 llama_infer.py --test_path prompts.txt --prediction_path result.txt \
128-
--load_model_path ../Linly-ChatFlow-7B/chatflow_7b.bin \
142+
--load_model_path ../ChatFlow-7B/chatflow_7b.bin \
129143
--config_path config/llama_7b_config.json \
130-
--spm_model_path ../Linly-ChatFlow-7B/tokenizer.model --seq_length 512 --use_int8
144+
--spm_model_path ../ChatFlow-7B/tokenizer.model --seq_length 512 --use_int8
131145
```
132146

133147
### 微服务部署
134148

135149
安装依赖:flask
136150
```bash
137-
python3 llama_server.py --load_model_path ../Linly-ChatFlow-7B/chatflow_7b.bin \
151+
python3 llama_server.py --load_model_path ../ChatFlow-7B/chatflow_7b.bin \
138152
--config_path config/llama_7b_config.json \
139-
--spm_model_path ../Linly-ChatFlow-7B/tokenizer.model --seq_length 512
153+
--spm_model_path ../ChatFlow-7B/tokenizer.model --seq_length 512
140154

141155
curl -H 'Content-Type: application/json' http://127.0.0.1:8888/chat -d '{"question": "北京有什么好玩的地方?"}'
142156
```
@@ -180,7 +194,7 @@ python3 scripts/convert_llama_from_huggingface_to_tencentpretrain.py --input_mod
180194
--output_model_path models/llama-7b.bin --type 7B
181195
```
182196

183-
也可以下载[基础模型 Linly-Chinese-LLaMA-7B](https://huggingface.co/P01son/Linly-Chinese-LLaMA-7B/)进行增量训练,不需要转换格式。
197+
也可以下载[基础模型 Linly-Chinese-LLaMA-7B](https://huggingface.co/Linly-AI/Chinese-LLaMA-7B/)进行增量训练,不需要转换格式。
184198

185199
#### 预处理
186200
下载[中文预训练语料](corpus/README.md)
@@ -399,6 +413,25 @@ Linly-ChatFlow 完全基于社区开放语料训练,内容未经人工修正
399413
- [ ] 基于 BLOOM 的中文基础模型
400414
- [ ] 强化学习
401415

416+
## Citation
417+
418+
```
419+
@article{zhao2022tencentpretrain,
420+
title={TencentPretrain: A Scalable and Flexible Toolkit for Pre-training Models of Different Modalities},
421+
author={Zhao, Zhe and Li, Yudong and Hou, Cheng and Zhao, Jing and Tian, Rong and Liu, Weijie and Chen, Yiren and Sun, Ningyuan and Liu, Haoyan and Mao, Weiquan and others},
422+
journal={arXiv preprint arXiv:2212.06385},
423+
year={2022}
424+
}
425+
426+
@inproceedings{li2022csl,
427+
title={CSL: A Large-scale Chinese Scientific Literature Dataset},
428+
author={Li, Yudong and Zhang, Yuqing and Zhao, Zhe and Shen, Linlin and Liu, Weijie and Mao, Weiquan and Zhang, Hui},
429+
booktitle={Proceedings of the 29th International Conference on Computational Linguistics},
430+
pages={3917--3923},
431+
year={2022}
432+
}
433+
```
434+
402435
## License
403436

404437
Our code and documents are released under Apache Licence 2.0

assets/sponsors/logo-1.png

3.68 KB
Loading

assets/sponsors/logo-2.png

2.28 KB
Loading

assets/wechat.jpg

850 Bytes
Loading

0 commit comments

Comments
 (0)