--- license: apache-2.0 datasets: - BelleGroup/train_1M_CN - BelleGroup/multiturn_chat_0.8M - jeffwan/sharegpt_vicuna language: - zh - en library_name: transformers pipeline_tag: text-generation tags: - chat widget: - text: ": Hello : " example_title: "Hello" - text: ": 你好 : " example_title: "你好" - text: ": What should I do if I can't sleep at night? : " example_title: "insomnia" - text: ": 晚上睡不着应该怎么办? : " example_title: "失眠" --- # ChatBLOOM ChatBLOOM是基于[BLOOM](https://huggingface.co/bigscience/bloom-1b7)(17亿参数)训练的中英双语对话语言模型,此模型为SFT版本。 详见[Github](https://github.com/NicholasCao/ChatBloom)。 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. See [Github](https://github.com/NicholasCao/ChatBloom) for details. ## Usage ```python tokenizer = AutoTokenizer.from_pretrained('nicholascao/chatbloom-1b7-sft') model = AutoModelForCausalLM.from_pretrained('nicholascao/chatbloom-1b7-sft') generation_config = GenerationConfig.from_pretrained('nicholascao/chatbloom-1b7-sft') inputs = tokenizer(': Hello : ', return_tensors='pt').to(torch.cuda.current_device()) model.to(torch.cuda.current_device()) output = model.generate(**inputs, generation_config=generation_config) output = tokenizer.decode(output[0], skip_special_tokens=True) print(output) ```