Downloads · 30 days
2
4% of all-time downloads
romaricnadjire/nllb-ewe-en-fr-multilingual-lora
nllb-ewe-en-fr-multilingual-lora is a translation model from romaricnadjire. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as cc-by-nc-4.0.
A LoRA adapter for facebook/nllb-200-distilled-600M fine-tuned for multi-directional translation between Ewe (eweLatn), English (engLatn) and French (fraLatn). A single adapter handles all six directions (Ewe as both…
Downloads · 30 days
2
4% of all-time downloads
All-time downloads
48
Public
Repo size
3.3 GB
Likes
0
Public
Click a slice to open those files.
.json64.9 MB · 63%
From the Hugging Face model README
A LoRA adapter for facebook/nllb-200-distilled-600M
fine-tuned for multi-directional translation between Ewe (ewe_Latn),
English (eng_Latn) and French (fra_Latn). A single adapter handles all
six directions (Ewe as both source and target).
ee), English (en), French (fr)facebook/nllb-200-distilled-600MTest-set BLEU / chrF++ (sacreBLEU), per direction:
| Direction | BLEU ↑ | chrF++ ↑ | n |
|---|---|---|---|
| ewe → eng | 26.16 | 44.88 | 4336 |
| eng → ewe | 23.29 | 43.18 | 4340 |
| ewe → fra | 6.27 | 24.61 | 2362 |
| fra → ewe | 4.12 | 29.09 | 2363 |
| eng → fra | 41.55 | 56.43 | 1988 |
| fra → eng | 46.39 | 65.45 | 1988 |
Ewe↔English is usable; Ewe↔French is weak (much less parallel French↔Ewe data) and should be considered experimental.
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from peft import PeftModel
BASE = "facebook/nllb-200-distilled-600M"
ADAPTER = "romaricnadjire/nllb-ewe-en-fr-multilingual-lora"
CODE = {"ee": "ewe_Latn", "en": "eng_Latn", "fr": "fra_Latn"}
tokenizer = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForSeq2SeqLM.from_pretrained(BASE)
model = PeftModel.from_pretrained(model, ADAPTER).eval()
def translate(text, src, tgt, num_beams=4):
tokenizer.src_lang = CODE[src]
inputs = tokenizer(text, return_tensors="pt")
out = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids(CODE[tgt]),
max_new_tokens=128, num_beams=num_beams,
)
return tokenizer.batch_decode(out, skip_special_tokens=True)[0]
print(translate("Ŋdi na mi", "ee", "fr"))
facebook/nllb-200-distilled-600M (frozen) + LoRA adapter.bible-uedin (ee↔en, ee↔fr) — public domain / OPUS terms.tchaye59 Ewe–English pairs (mixed sources incl. religious texts) — research use.facebook/nllb-200-distilled-600M) by Meta AI — CC-BY-NC 4.0.masakhane/mafand (CC-BY-NC) was used for evaluation only, never for training.This adapter is a derivative of facebook/nllb-200-distilled-600M and is released
under CC-BY-NC-4.0 (non-commercial). Please credit the base model (Meta NLLB-200)
and the data sources above.
Academic / portfolio project. Not legal advice; verify licenses before any non-research or commercial use.