Update README_zh.md
Browse files- README_zh.md +14 -16
README_zh.md
CHANGED
|
@@ -8,14 +8,14 @@ license: other
|
|
| 8 |
|
| 9 |
<h4 align="center">
|
| 10 |
<p>
|
| 11 |
-
<a href="https://huggingface.co/BAAI/AquilaChat2-
|
| 12 |
<b>简体中文</b> |
|
| 13 |
</p>
|
| 14 |
</h4>
|
| 15 |
|
| 16 |
# 悟道·天鹰(Aquila2)
|
| 17 |
|
| 18 |
-
我们开源了我们的 **Aquila2** 系列,现在包括基础语言模型 **Aquila2-7B** 和 **Aquila2-
|
| 19 |
|
| 20 |
悟道 · 天鹰 Aquila 模型的更多细节将在官方技术报告中呈现。请关注官方渠道更新。
|
| 21 |
|
|
@@ -27,7 +27,7 @@ license: other
|
|
| 27 |
<p>
|
| 28 |
<br>
|
| 29 |
|
| 30 |
-
## 快速开始使用
|
| 31 |
|
| 32 |
|
| 33 |
## 使用方式/How to use
|
|
@@ -35,25 +35,23 @@ license: other
|
|
| 35 |
### 1. 推理/Inference
|
| 36 |
|
| 37 |
```python
|
| 38 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 39 |
import torch
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
| 42 |
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
|
| 43 |
-
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True)
|
| 44 |
model.eval()
|
| 45 |
-
model.to(device)
|
| 46 |
text = "请给出10个要到北京旅游的理由。"
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
out = tokenizer.decode(out.cpu().numpy().tolist())
|
| 53 |
-
print(out)
|
| 54 |
```
|
| 55 |
|
| 56 |
|
| 57 |
## 证书/License
|
| 58 |
|
| 59 |
-
Aquila2系列开源模型使用 [智源Aquila系列模型许可协议](https://huggingface.co/BAAI/AquilaChat2-
|
|
|
|
| 8 |
|
| 9 |
<h4 align="center">
|
| 10 |
<p>
|
| 11 |
+
<a href="https://huggingface.co/BAAI/AquilaChat2-70B/blob/main/README.md">English</a>
|
| 12 |
<b>简体中文</b> |
|
| 13 |
</p>
|
| 14 |
</h4>
|
| 15 |
|
| 16 |
# 悟道·天鹰(Aquila2)
|
| 17 |
|
| 18 |
+
我们开源了我们的 **Aquila2** 系列,现在包括基础语言模型 **Aquila2-7B**,**Aquila2-34B** 和 **Aquila2-70B** ,对话模型 **AquilaChat2-7B**,**AquilaChat2-34B** 和**AquilaChat2-70B** ,长文本对话模型**AquilaChat2-7B-16k** 和 **AquilaChat2-34B-16k**
|
| 19 |
|
| 20 |
悟道 · 天鹰 Aquila 模型的更多细节将在官方技术报告中呈现。请关注官方渠道更新。
|
| 21 |
|
|
|
|
| 27 |
<p>
|
| 28 |
<br>
|
| 29 |
|
| 30 |
+
## 快速开始使用
|
| 31 |
|
| 32 |
|
| 33 |
## 使用方式/How to use
|
|
|
|
| 35 |
### 1. 推理/Inference
|
| 36 |
|
| 37 |
```python
|
|
|
|
| 38 |
import torch
|
| 39 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 40 |
+
from transformers import BitsAndBytesConfig
|
| 41 |
+
|
| 42 |
+
model_info = "BAAI/AquilaChat2-70B"
|
| 43 |
tokenizer = AutoTokenizer.from_pretrained(model_info, trust_remote_code=True)
|
| 44 |
+
model = AutoModelForCausalLM.from_pretrained(model_info, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 45 |
model.eval()
|
|
|
|
| 46 |
text = "请给出10个要到北京旅游的理由。"
|
| 47 |
+
from predict import predict
|
| 48 |
+
out = predict(model, text, tokenizer=tokenizer, max_gen_len=200, top_p=0.95,
|
| 49 |
+
seed=1234, topk=100, temperature=0.9, sft=True,
|
| 50 |
+
model_name="AquilaChat2-70B")
|
| 51 |
+
print(out)
|
|
|
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
|
| 55 |
## 证书/License
|
| 56 |
|
| 57 |
+
Aquila2系列开源模型使用 [智源Aquila系列模型许可协议](https://huggingface.co/BAAI/AquilaChat2-70B/blob/main/BAAI-Aquila-Model-License-Agreement.pdf)
|