# Bloomz-7b1-instruct

This is Bloomz-7b1-mt model fine-tuned with multilingual instruction dataset and using Peft Lora fine-tuning. 
Following languages are supported: English, German, French, Spanish, Hindi, Indonesian, Japanese, Malaysian, Portuguese,
Russian, Thai, Vietnamese and Chinese.

## Usage

Following is the code to do the inference using this model:
```
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

peft_model_id = "cahya/bloomz-7b1-instruct"
config = PeftConfig.from_pretrained(peft_model_id)

model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, 
                                             load_in_8bit=True, device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)

# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)

batch = tokenizer("User: How old is the universe?\nAssistant: ", return_tensors='pt').to(0)


with torch.cuda.amp.autocast():
  output_tokens = model.generate(**batch, max_new_tokens=200,
                                 min_length=50,
                                 do_sample=True,
                                 top_k=40,
                                 top_p=0.9,
                                 temperature=0.2,
                                 repetition_penalty=1.2,
                                 num_return_sequences=1)

print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))
```
{"language": ["de", "en", "es", "fr", "hi", "id", "ja", "ms", "pt", "ru", "th", "vi", "zh"], "license": "bigscience-bloom-rail-1.0", "datasets": ["cahya/instructions-all"], "pipeline_tag": "text-generation", "widget": [{"text": "\u4e00\u4e2a\u4f20\u5947\u7684\u5f00\u7aef\uff0c\u4e00\u4e2a\u4e0d\u706d\u7684\u795e\u8bdd\uff0c\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u4e00\u90e8\u7535\u5f71\uff0c\u800c\u662f\u4f5c\u4e3a\u4e00\u4e2a\u8d70\u8fdb\u65b0\u65f6\u4ee3\u7684\u6807\u7b7e\uff0c\u6c38\u8fdc\u5f6a\u70b3\u53f2\u518c\u3002Would you rate the previous review as positive, neutral or negative?", "example_title": "zh-en sentiment"}, {"text": "\u4e00\u4e2a\u4f20\u5947\u7684\u5f00\u7aef\uff0c\u4e00\u4e2a\u4e0d\u706d\u7684\u795e\u8bdd\uff0c\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u4e00\u90e8\u7535\u5f71\uff0c\u800c\u662f\u4f5c\u4e3a\u4e00\u4e2a\u8d70\u8fdb\u65b0\u65f6\u4ee3\u7684\u6807\u7b7e\uff0c\u6c38\u8fdc\u5f6a\u70b3\u53f2\u518c\u3002\u4f60\u8ba4\u4e3a\u8fd9\u53e5\u8bdd\u7684\u7acb\u573a\u662f\u8d5e\u626c\u3001\u4e2d\u7acb\u8fd8\u662f\u6279\u8bc4\uff1f", "example_title": "zh-zh sentiment"}, {"text": "Suggest at least five related search terms to \"M\u1ea1ng neural nh\u00e2n t\u1ea1o\".", "example_title": "vi-en query"}, {"text": "Proposez au moins cinq mots cl\u00e9s concernant \u00abR\u00e9seau de neurones artificiels\u00bb.", "example_title": "fr-fr query"}, {"text": "Explain in a sentence in Telugu what is backpropagation in neural networks.", "example_title": "te-en qa"}, {"text": "Why is the sky blue?", "example_title": "en-en qa"}, {"text": "Write a fairy tale about a troll saving a princess from a dangerous dragon. The fairy tale is a masterpiece that has achieved praise worldwide and its moral is \"Heroes Come in All Shapes and Sizes\". Story (in Spanish):", "example_title": "es-en fable"}, {"text": "Write a fable about wood elves living in a forest that is suddenly invaded by ogres. The fable is a masterpiece that has achieved praise worldwide and its moral is \"Violence is the last refuge of the incompetent\". Fable (in Hindi):", "example_title": "hi-en fable"}]}
text-generation de en es fr hi id ja ms pt ru th vi zh dataset:cahya/instructions-all license:bigscience-bloom-rail-1.0 region:us
TAGS
#text-generation #de #en #es #fr #hi #id #ja #ms #pt #ru #th #vi #zh #dataset-cahya/instructions-all #license-bigscience-bloom-rail-1.0 #region-us 

# Bloomz-7b1-instruct

This is Bloomz-7b1-mt model fine-tuned with multilingual instruction dataset and using Peft Lora fine-tuning. 
Following languages are supported: English, German, French, Spanish, Hindi, Indonesian, Japanese, Malaysian, Portuguese,
Russian, Thai, Vietnamese and Chinese.

## Usage

Following is the code to do the inference using this model:

# Bloomz-7b1-instruct

This is Bloomz-7b1-mt model fine-tuned with multilingual instruction dataset and using Peft Lora fine-tuning. 
Following languages are supported: English, German, French, Spanish, Hindi, Indonesian, Japanese, Malaysian, Portuguese,
Russian, Thai, Vietnamese and Chinese. ## Usage

Following is the code to do the inference using this model:
TAGS
#text-generation #de #en #es #fr #hi #id #ja #ms #pt #ru #th #vi #zh #dataset-cahya/instructions-all #license-bigscience-bloom-rail-1.0 #region-us 
 # Bloomz-7b1-instruct

This is Bloomz-7b1-mt model fine-tuned with multilingual instruction dataset and using Peft Lora fine-tuning. 
Following languages are supported: English, German, French, Spanish, Hindi, Indonesian, Japanese, Malaysian, Portuguese,
Russian, Thai, Vietnamese and Chinese. ## Usage

Following is the code to do the inference using this model:
TAGS
#text-generation #de #en #es #fr #hi #id #ja #ms #pt #ru #th #vi #zh #dataset-cahya/instructions-all #license-bigscience-bloom-rail-1.0 #region-us 
# Bloomz-7b1-instruct

This is Bloomz-7b1-mt model fine-tuned with multilingual instruction dataset and using Peft Lora fine-tuning. 
Following languages are supported: English, German, French, Spanish, Hindi, Indonesian, Japanese, Malaysian, Portuguese,
Russian, Thai, Vietnamese and Chinese.## Usage

Following is the code to do the inference using this model: