Commit
·
9ccfebc
1
Parent(s):
38a6053
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,8 +4,20 @@ language:
|
|
| 4 |
- zh
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
widget:
|
| 7 |
-
- text: "
|
|
|
|
| 8 |
---
|
| 9 |
-
The model is based on [bigscience/bloom-1b7](https://huggingface.co/bigscience/bloom-1b7).
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
- zh
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
widget:
|
| 7 |
+
- text: "中国的首都是"
|
| 8 |
+
|
| 9 |
---
|
|
|
|
| 10 |
|
| 11 |
+
This model is based on [bigscience/bloom-1b7](https://huggingface.co/bigscience/bloom-1b7).
|
| 12 |
+
|
| 13 |
+
We pruned its vocabulary from 250880 to 46145 with Chinese corpus to reduce GPU memory usage. So the total parameter is 1.4b now.
|
| 14 |
+
|
| 15 |
+
# How to use
|
| 16 |
+
```python
|
| 17 |
+
from transformers import BloomTokenizerFast, BloomForCausalLM
|
| 18 |
+
|
| 19 |
+
tokenizer = BloomTokenizerFast.from_pretrained('Langboat/bloom-1.4b-zh')
|
| 20 |
+
model = BloomForCausalLM.from_pretrained('Langboat/bloom-1.4b-zh')
|
| 21 |
+
|
| 22 |
+
print(tokenizer.batch_decode(model.generate(tokenizer.encode('中国的首都是', return_tensors='pt'))))
|
| 23 |
+
```
|