|
27 | 27 |
|
28 | 28 | <img src="assets/chatflow.jpg" width=90% align=center /> |
29 | 29 |
|
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) |
31 | 31 |
|
32 | 32 | ## News |
33 | 33 |
|
34 | | -+ **[2023/4/27]** 🚀 正式发布 Linly-ChatFlow-13B 对话模型、Linly-Chinese-LLaMA-33B 中文基础模型 |
| 34 | ++ **[2023/5/14]** 🚀 更新 v1.1 版,使用更多训练数据,ChatFlow 序列长度提升至1024,提供在线试用和 API 接口 |
35 | 35 |
|
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 量化推理和微服务部署,大幅度提升推理速度并降低内存消耗 |
37 | 39 |
|
38 | 40 | + **[2023/4/8]** [TencentPretrain](https://github.com/Tencent/TencentPretrain) 现已支持 LoRA 训练和 DeepSpeed Zero-3 Offload 流水线并行 |
39 | 41 |
|
|
65 | 67 | 请确认在已[获得许可](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform?usp=send_form)的前提下使用本仓库中的模型。 |
66 | 68 |
|
67 | 69 |
|
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) |
71 | 73 | **65B**:训练中 |
72 | 74 |
|
73 | 75 |
|
74 | 76 | 🤗 **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 格式互转 |
78 | 78 |
|
79 | 79 | ### 训练情况 |
80 | 80 |
|
|
84 | 84 | </center> |
85 | 85 |
|
86 | 86 |
|
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 | +``` |
89 | 98 |
|
90 | | -<img src="assets/huggingface_demo.jpg"/> |
| 99 | +感谢 [HuggingFace](https://huggingface.co/) 和 [OpenBayes](https://openbayes.com/) 提供用于在线体验的计算资源。 |
91 | 100 |
|
92 | | -如果想在自己的环境上构造交互式demo,欢迎关注和star项目:[llama_inference](https://github.com/fengyh3/llama_inference) |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +如果想在自己的环境上构造交互式demo,欢迎关注和star项目:[llama_inference](https://github.com/ProjectD-AI/llama_inference) |
93 | 107 |
|
94 | 108 |
|
95 | 109 | ## 快速开始 |
96 | 110 |
|
97 | 111 | 下载预训练 ChatLLaMA 权重,安装依赖,测试环境: py3.8.12 cuda11.2.2 cudnn8.1.1.33-1 torch1.9.0 bitsandbytes0.37.2 |
98 | 112 |
|
99 | | -**解码参数及详细使用说明请参考 [llama_inference](https://github.com/fengyh3/llama_inference)** |
| 113 | +**解码参数及详细使用说明请参考 [llama_inference](https://github.com/ProjectD-AI/llama_inference)** |
100 | 114 |
|
101 | 115 | ```bash |
102 | 116 | 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 |
105 | 119 |
|
106 | 120 | cd llama_inference |
107 | 121 | vi beginning.txt #编辑用户输入,例如"上海有什么好玩的地方?" |
108 | 122 |
|
109 | 123 | 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 \ |
111 | 125 | --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 |
113 | 127 | ``` |
114 | 128 |
|
115 | 129 | ### 多轮对话 |
116 | 130 |
|
117 | 131 | ```bash |
118 | 132 | 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 \ |
120 | 134 | --config_path ./config/llama_7b_config.json \ |
121 | | - --spm_model_path ../Linly-ChatFlow-7B/tokenizer.model |
| 135 | + --spm_model_path ../ChatFlow-7B/tokenizer.model |
122 | 136 | ``` |
123 | 137 |
|
124 | 138 | ### Int8 推理加速 |
125 | 139 |
|
126 | 140 | ```bash |
127 | 141 | 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 \ |
129 | 143 | --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 |
131 | 145 | ``` |
132 | 146 |
|
133 | 147 | ### 微服务部署 |
134 | 148 |
|
135 | 149 | 安装依赖:flask |
136 | 150 | ```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 \ |
138 | 152 | --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 |
140 | 154 |
|
141 | 155 | curl -H 'Content-Type: application/json' http://127.0.0.1:8888/chat -d '{"question": "北京有什么好玩的地方?"}' |
142 | 156 | ``` |
@@ -180,7 +194,7 @@ python3 scripts/convert_llama_from_huggingface_to_tencentpretrain.py --input_mod |
180 | 194 | --output_model_path models/llama-7b.bin --type 7B |
181 | 195 | ``` |
182 | 196 |
|
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/)进行增量训练,不需要转换格式。 |
184 | 198 |
|
185 | 199 | #### 预处理 |
186 | 200 | 下载[中文预训练语料](corpus/README.md), |
@@ -399,6 +413,25 @@ Linly-ChatFlow 完全基于社区开放语料训练,内容未经人工修正 |
399 | 413 | - [ ] 基于 BLOOM 的中文基础模型 |
400 | 414 | - [ ] 强化学习 |
401 | 415 |
|
| 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 | + |
402 | 435 | ## License |
403 | 436 |
|
404 | 437 | Our code and documents are released under Apache Licence 2.0 |
|
0 commit comments