wangyulong commited on
Commit
8b0c19a
1 Parent(s): 3b520c7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -2
README.md CHANGED
@@ -4,10 +4,20 @@ language:
4
  - zh
5
  pipeline_tag: text-generation
6
  widget:
7
- - text: "生命、宇宙以及一切的终极答案是"
8
 
9
  ---
10
 
11
  The model is based on [bigscience/bloom-560m](https://huggingface.co/bigscience/bloom-560m).
12
 
13
- To reduce GPU memory usage, we pruned its vocabulary from 250880 to 42437 with Chinese corpus. So the total parameter is 389m now.
 
 
 
 
 
 
 
 
 
 
 
4
  - zh
5
  pipeline_tag: text-generation
6
  widget:
7
+ - text: "中国的首都是"
8
 
9
  ---
10
 
11
  The model is based on [bigscience/bloom-560m](https://huggingface.co/bigscience/bloom-560m).
12
 
13
+ To reduce GPU memory usage, we pruned its vocabulary from 250880 to 42437 with Chinese corpus. So the total parameter is 389m now.
14
+
15
+ # How to use
16
+ ```python
17
+ from transformers import BloomTokenizerFast, BloomForCausalLM
18
+
19
+ tokenizer = BloomTokenizerFast.from_pretrained('Langboat/bloom-389m-zh')
20
+ model = BloomForCausalLM.from_pretrained('Langboat/bloom-389m-zh')
21
+
22
+ print(tokenizer.batch_decode(model.generate(tokenizer.encode('中国的首都是', return_tensors='pt'))))
23
+ ```