nicholascao commited on
Commit
24a2272
1 Parent(s): db2424b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -1
README.md CHANGED
@@ -12,9 +12,24 @@ pipeline_tag: text-generation
12
  tags:
13
  - chat
14
  ---
 
15
 
16
  ChatBLOOM是基于[BLOOM](https://huggingface.co/bigscience/bloom-1b7)(17亿参数)训练的中英双语对话语言模型,此模型为SFT版本。
17
  详见[Github](https://github.com/NicholasCao/ChatBloom)。
18
 
19
  ChatBLOOM is a Chinese-English bilingual dialogue language model trained based on [BLOOM](https://huggingface.co/bigscience/bloom-1b7) (1.7 billion parameters). This model is the SFT version.
20
- See [Github](https://github.com/NicholasCao/ChatBloom) for details.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  tags:
13
  - chat
14
  ---
15
+ # ChatBLOOM
16
 
17
  ChatBLOOM是基于[BLOOM](https://huggingface.co/bigscience/bloom-1b7)(17亿参数)训练的中英双语对话语言模型,此模型为SFT版本。
18
  详见[Github](https://github.com/NicholasCao/ChatBloom)。
19
 
20
  ChatBLOOM is a Chinese-English bilingual dialogue language model trained based on [BLOOM](https://huggingface.co/bigscience/bloom-1b7) (1.7 billion parameters). This model is the SFT version.
21
+ See [Github](https://github.com/NicholasCao/ChatBloom) for details.
22
+
23
+ ## Usage
24
+ ```python
25
+ tokenizer = AutoTokenizer.from_pretrained('nicholascao/chatbloom-1b7-sft')
26
+ model = AutoModelForCausalLM.from_pretrained('nicholascao/chatbloom-1b7-sft')
27
+ generation_config = GenerationConfig.from_pretrained('nicholascao/chatbloom-1b7-sft')
28
+
29
+ inputs = tokenizer('<Human>: Hello <eoh> <Assistant>: ', return_tensors='pt').to(torch.cuda.current_device())
30
+ model.to(torch.cuda.current_device())
31
+
32
+ output = model.generate(**inputs, generation_config=generation_config)
33
+ output = tokenizer.decode(output[0], skip_special_tokens=True)
34
+ print(output)
35
+ ```