Downloads · 30 days
0
Mollel/Gemma_Swahili_Mollel_1_epoch
Gemma_Swahili_Mollel_1_epoch is a machine learning model from Mollel. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
- Developed by: Mollel - License: apache-2.0 - Finetuned from model : unsloth/gemma-7b-bnb-4bit
Downloads · 30 days
0
Access
Public
Updated Apr 3, 2024
Repo size
222 MB
Likes
2
Public
Click a slice to open those files.
.safetensors200 MB · 90%
From the Hugging Face model README
This gemma model was trained 2x faster with Unsloth and Huggingface's TRL library.
!pip install transformers peft accelerate bitsandbytes
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained(
"Mollel/Gemma_Swahili_Mollel_1_epoch",
load_in_4bit = False
)
tokenizer = AutoTokenizer.from_pretrained("Mollel/Gemma_Swahili_Mollel_1_epoch")
input_prompt = """
### Instruction:
{}
### Input:
{}
### Response:
{}"""
input_text = input_prompt.format(
"Andika aya fupi kuhusu mada iliyotolewa.", # instruction
"Umuhimu wa kutumia nishati inayoweza kurejeshwa", # input
"", # output - leave this blank for generation!
)
inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
response = tokenizer.batch_decode(outputs)[0]
print(response)