Downloads · 30 days
0
acul3/bloomz-7b-instructions-lora
bloomz-7b-instructions-lora is a machine learning model from acul3. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as bigscience-bloom-rail-1.0.
Downloads · 30 days
0
Access
Public
Updated Feb 15, 2023
Repo size
15.8 MB
Likes
0
Public
Click a slice to open those files.
.bin15.8 MB · 100%
From the Hugging Face model README
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftMode
model_name_or_path = "bigscience/bloomz-7b1-mt"
peft_model_id = "acul3/bloomz-7b-instructions-lora"
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, device_map="auto")
model = PeftModel.from_pretrained(model, peft_model_id)
text = "Bagaimana Merebus Telur ?"
tokenizer = AutoTokenizer.from_pretrained("bigscience/bloomz-7b1-mt")
text = "User: " + text + "\n\Asisten: "
input_ids = tokenizer(text, return_tensors="pt").input_ids
generated_ids = model.generate(input_ids=input_ids.to("cuda"), max_length=400, pad_token_id=tokenizer.eos_token_id, do_sample=True, top_p=0.95, temperature=0.5, penalty_alpha=0.6, top_k=4, repetition_penalty=1.03, num_return_sequences=1)
res = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
print(res)