Downloads · 30 days
3
1% of all-time downloads
mwkhettab/nllb-200-darjia-en
nllb-200-darjia-en 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 Moroccan Darija to English.
Downloads · 30 days
3
1% of all-time downloads
All-time downloads
310
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 Moroccan Darija to English.
It is intended for informal, conversational Darija rather than Modern Standard Arabic.
ary_Arab)eng_Latn)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-darija-en"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
text = "شنو الطقس دابا برا؟"
inputs = tokenizer(text, return_tensors="pt", max_length=512)
outputs = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids("eng_Latn"),
max_new_tokens=128,
num_beams=5,
)
translation = tokenizer.decode(
outputs[0],
skip_special_tokens=True,
).strip()
print(translation)