Downloads · 30 days
14
5% of all-time downloads
mwkhettab/nllb-200-en-darija
nllb-200-en-darija is a translation model from mwkhettab. Use it when you need text moved from one language to another. The card lists the license as mit.
This model is a fine-tuned version of facebook/nllb-200-distilled-600m for machine translation from English to Moroccan Darija.
Downloads · 30 days
14
5% of all-time downloads
All-time downloads
291
Public
Parameters
615M
2.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of facebook/nllb-200-distilled-600m for
machine translation from English to Moroccan Darija.
It is intended for informal, conversational Darija rather than Modern Standard Arabic.
eng_Latn)ary_Arab)The model was fine-tuned on a custom English–Darija parallel dataset compiled from the Darija Open Dataset.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "mwkhettab/nllb-200-en-darija"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
text = "How was your day?"
inputs = tokenizer(text, return_tensors="pt", max_length=512)
outputs = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids("ary_Arab"),
max_new_tokens=128,
num_beams=5,
)
translation = tokenizer.decode(
outputs[0],
skip_special_tokens=True,
).strip()
print(translation)