Downloads · 30 days
0
sbhikha/Gemma9B_Inkuba_LoRa_adapter_v1
Gemma9B_Inkuba_LoRa_adapter_v1 is a machine learning model from sbhikha. 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.
This model card contains a LoRa adapter for the Gemma-9b-it model. It aims to improve Machine Translation performance into South African langauges.
Downloads · 30 days
0
Access
Public
Updated Aug 29, 2024
Repo size
864 MB
Likes
0
Public
Click a slice to open those files.
.safetensors864 MB · 100%
From the Hugging Face model README
This model card contains a LoRa adapter for the Gemma-9b-it model. It aims to improve Machine Translation performance into South African langauges.
The LoRa adapter was trained on a subset of the lelapa/Inkuba-instruct dataset targeting the langauges English, isiZulu and isiXhosa. The data was sampled from the Inkuba-instruct dataset using langauge-ids.
Aims to improve Machine Translation performance on South African langauges. Based on Gemma-9b-it, so the model is generally task adaptable.
The datatset was sampled from lelapa/Inkuba-instruct dataset. Minor inconsistencies were present in translations from the training data.
Use the code below to get started with the model.
base_model_id = "google/gemma-2-9b-it"
adapter_model_id = "sbhikha/Gemma9B_Inkuba_double_quant"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
double_quant_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config = double_quant_config,
device_map="auto"
)
config = PeftConfig.from_pretrained(adapter_model_id)
peft_model = PeftModel.from_pretrained(model, adapter_model_id)
text = "Translate this from English to isiZulu: Sawubona, unjani?"
input_ids = tokenizer(text), return_tensors="pt").to("cuda:0")
outputs = peft_model.generate(**input_ids, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
LoRa Config:
Training Arguments:
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).