Downloads · 30 days
6
1% of all-time downloads
Anassk/MoroccanDarija-Llama-3.1-8B
MoroccanDarija-Llama-3.1-8B is a text generation model from Anassk. Use it when you need the model to write or continue text. The card lists the license as mit.
This model translates Moroccan Darija (Moroccan Arabic) to English. It's based on the Llama 3.1 8B model, fine-tuned on a dataset of Darija-English sentence pairs.
Downloads · 30 days
6
1% of all-time downloads
All-time downloads
402
Public
Repo size
185 MB
Likes
4
Public
Click a slice to open those files.
.safetensors168 MB · 91%
From the Hugging Face model README
This model translates Moroccan Darija (Moroccan Arabic) to English. It's based on the Llama 3.1 8B model, fine-tuned on a dataset of Darija-English sentence pairs.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "Anassk/MoroccanDarija-Llama-3.1-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
def translate(text):
inputs = tokenizer(f"Translate the following Darija text to English: {text}", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example usage
darija_text = "واش كاين شي حد هنا كيهضر الدارجة؟"
print(translate(darija_text))
This model's performance may vary depending on the complexity and specific dialect of the input Darija text. It works best with standard Moroccan Darija phrases and sentences. Highly colloquial or region-specific expressions may pose challenges.