Commit
·
677d4fe
1
Parent(s):
541ddd4
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- BelleGroup/train_0.5M_CN
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- zh
|
| 8 |
+
tags:
|
| 9 |
+
- text-generation-inference
|
| 10 |
+
widget:
|
| 11 |
+
- text: |-
|
| 12 |
+
<|im_start|>user
|
| 13 |
+
请以『春天的北京』为题写一首诗歌
|
| 14 |
+
<|im_end|>
|
| 15 |
+
<|im_start|>assistant
|
| 16 |
+
example_title: generation zh
|
| 17 |
+
---
|
| 18 |
+
# Baichuan 7B ChatML
|
| 19 |
+
|
| 20 |
+
## 介绍 Introduction
|
| 21 |
+
|
| 22 |
+
`baichuan-7B-chatml` 是支持多轮对话兼容于 ChatML 的模型。
|
| 23 |
+
模型基于 [baichuan-7B](https://huggingface.co/baichuan-inc/baichuan-7B) 微调而成。
|
| 24 |
+
`baichuan-7B-chatml` 模型支持商用。但按照baichuan-7B的要求,如果将baichuan-7B衍生品用作商业用途,需要联系[baichuan-7B 的许可方](https://github.com/baichuan-inc/baichuan-7B#%E5%8D%8F%E8%AE%AE)。
|
| 25 |
+
|
| 26 |
+
__需要注意:在面对事实性知识任务时,模型可能会生成不正确的信息或者产生不稳定的输出(有时可以返回正确答案,有时不能)。__
|
| 27 |
+
|
| 28 |
+
`baichuan-7B-chatml` is a model that supports multi-turn dialog and is compatible with ChatML.
|
| 29 |
+
The model is fine-tuned based on [baichuan-7B](https://huggingface.co/baichuan-inc/baichuan-7B).
|
| 30 |
+
`baichuan-7B-chatml` model supports commercial use. However, according to the requirements of baichuan-7B, if baichuan-7B derivatives are used for commercial purposes, you need to contact [baichuan-7B](https://github.com/baichuan-inc/baichuan-7B#%E5%8D%8F%E8%AE%AE)。
|
| 31 |
+
|
| 32 |
+
__Note: When dealing with factual knowledge tasks, it may generate incorrect information or unstable output (sometimes it can return the correct answer, sometimes not).__
|
| 33 |
+
|
| 34 |
+
## 代码示例 Examples
|
| 35 |
+
|
| 36 |
+
模型在百川的基础上提供了对轮对话的函数供调用。
|
| 37 |
+
|
| 38 |
+
The model provides a function for multi-turn dialogs.
|
| 39 |
+
|
| 40 |
+
```ipython
|
| 41 |
+
>>> from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 42 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("tibok/baichuan-7B-chatml", trust_remote_code=True)
|
| 43 |
+
>>> model = AutoModelForCausalLM.from_pretrained("tibok/baichuan-7B-chatml", device_map="auto", trust_remote_code=True)
|
| 44 |
+
>>> response, history = model.chat(tokenizer, "请以『春天的北京』为题写一首诗歌", history=[])
|
| 45 |
+
春天的北京,
|
| 46 |
+
花开万丈,
|
| 47 |
+
春意盎然,
|
| 48 |
+
清风送暖。
|
| 49 |
+
<|im_end|>
|
| 50 |
+
>>> response, history = model.chat(tokenizer, "能不能再写一首关于香山的?", history=history)
|
| 51 |
+
>>> print(response)
|
| 52 |
+
香山之巅,
|
| 53 |
+
芳草连天。
|
| 54 |
+
清泉潺潺,
|
| 55 |
+
山峦绵绵。
|
| 56 |
+
<|im_end|>
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## 更多细节 Details
|
| 60 |
+
|
| 61 |
+
- Dataset: [BelleGroup/train_0.5M_CN](https://huggingface.co/datasets/BelleGroup/train_0.5M_CN)
|
| 62 |
+
- steps: 13800
|
| 63 |
+
- batch_size: 8
|
| 64 |
+
- seq_len: 2048
|