Update README.md
Browse files
README.md
CHANGED
|
@@ -19,6 +19,23 @@ The **Yi** series models are large language models trained from scratch by devel
|
|
| 19 |
|
| 20 |
- 🎯 **2023/11/02**: The base model of `Yi-6B` and `Yi-34B`
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
## Model Performance
|
| 23 |
|
| 24 |
| Model | MMLU | CMMLU | C-Eval | GAOKAO | BBH | Commonsense Reasoning | Reading Comprehension | Math & Code |
|
|
|
|
| 19 |
|
| 20 |
- 🎯 **2023/11/02**: The base model of `Yi-6B` and `Yi-34B`
|
| 21 |
|
| 22 |
+
## Dependency Installation
|
| 23 |
+
|
| 24 |
+
```shell
|
| 25 |
+
pip install transformers==4.34.0 sentencepiece==0.1.99 accelerate==0.24.1
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Generation Demonstration
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 32 |
+
model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-6B", device_map="auto", torch_dtype="auto", trust_remote_code=True)
|
| 33 |
+
tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-6B", trust_remote_code=True)
|
| 34 |
+
inputs = tokenizer('Please count number for me: 1, 2, 3', return_tensors="pt")
|
| 35 |
+
outputs = model.generate(inputs.input_ids.cuda(), max_new_tokens=256)
|
| 36 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
## Model Performance
|
| 40 |
|
| 41 |
| Model | MMLU | CMMLU | C-Eval | GAOKAO | BBH | Commonsense Reasoning | Reading Comprehension | Math & Code |
|