Update README.md
Browse files
README.md
CHANGED
@@ -30,6 +30,11 @@ tasks:
|
|
30 |
- [📊 Benchmark评估/Benchmark Evaluation](#Benchmark)
|
31 |
- [📜 声明与协议/Terms and Conditions](#Terms)
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
# <span id="Introduction">模型介绍/Introduction</span>
|
35 |
|
@@ -59,9 +64,16 @@ In the Baichuan 2 series models, we have utilized the new feature `F.scaled_dot_
|
|
59 |
import torch
|
60 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
61 |
from transformers.generation.utils import GenerationConfig
|
62 |
-
tokenizer = AutoTokenizer.from_pretrained("baichuan-inc/Baichuan2-13B-Chat-4bits",
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
messages = []
|
66 |
messages.append({"role": "user", "content": "解释一下“温故而知新”"})
|
67 |
response = model.chat(tokenizer, messages)
|
@@ -70,6 +82,7 @@ print(response)
|
|
70 |
|
71 |
这句话鼓励我们在学习和生活中不断地回顾和反思过去的经验,从而获得新的启示和成长。通过重温旧的知识和经历,我们可以发现新的观点和理解,从而更好地应对不断变化的世界和挑战。
|
72 |
```
|
|
|
73 |
|
74 |
# <span id="Benchmark">Benchmark 结果/Benchmark Evaluation</span>
|
75 |
|
|
|
30 |
- [📊 Benchmark评估/Benchmark Evaluation](#Benchmark)
|
31 |
- [📜 声明与协议/Terms and Conditions](#Terms)
|
32 |
|
33 |
+
# 更新/Update
|
34 |
+
[2023.12.29] 🎉🎉🎉 我们发布了 **[Baichuan2-13B-Chat](https://huggingface.co/baichuan-inc/Baichuan2-13B-Chat) v2** 版本。其中:
|
35 |
+
- 大幅提升了模型的综合能力,特别是数学和逻辑推理、复杂指令跟随能力。
|
36 |
+
- 模型处理长度从 4096 提升 至8192 。
|
37 |
+
- 使用时需指定revision=v2.0,详细方法参考[快速开始](#Start)
|
38 |
|
39 |
# <span id="Introduction">模型介绍/Introduction</span>
|
40 |
|
|
|
64 |
import torch
|
65 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
66 |
from transformers.generation.utils import GenerationConfig
|
67 |
+
tokenizer = AutoTokenizer.from_pretrained("baichuan-inc/Baichuan2-13B-Chat-4bits",
|
68 |
+
revision="v2.0",
|
69 |
+
use_fast=False,
|
70 |
+
trust_remote_code=True)
|
71 |
+
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan2-13B-Chat-4bits",
|
72 |
+
revision="v2.0",
|
73 |
+
device_map="auto",
|
74 |
+
torch_dtype=torch.bfloat16,
|
75 |
+
trust_remote_code=True)
|
76 |
+
model.generation_config = GenerationConfig.from_pretrained("baichuan-inc/Baichuan2-13B-Chat-4bits", revision="v2.0")
|
77 |
messages = []
|
78 |
messages.append({"role": "user", "content": "解释一下“温故而知新”"})
|
79 |
response = model.chat(tokenizer, messages)
|
|
|
82 |
|
83 |
这句话鼓励我们在学习和生活中不断地回顾和反思过去的经验,从而获得新的启示和成长。通过重温旧的知识和经历,我们可以发现新的观点和理解,从而更好地应对不断变化的世界和挑战。
|
84 |
```
|
85 |
+
**注意:如需使用老版本,需手动指定revision参数,设置revision=v1.0**
|
86 |
|
87 |
# <span id="Benchmark">Benchmark 结果/Benchmark Evaluation</span>
|
88 |
|