Downloads · 30 days
6
12% of all-time downloads
YouNess01/nllb-fra-tzm
nllb-fra-tzm is a translation model from YouNess01. 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.
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
51
Public
Repo size
231 MB
Likes
1
Public
Click a slice to open those files.
.pt139 MB · 60%
From the Hugging Face model README
🌟 BLEU Score: 50.86
Premier modèle haute performance pour la traduction français → tamazight (écriture Tifinagh).
Ce modèle est optimisé pour du texte formel (documents, articles, littérature) et ne généralise pas bien aux expressions quotidiennes courantes.
| Domain | BLEU |
|---|---|
| Texte formel/littéraire | 50.86 ⭐⭐⭐⭐⭐ |
| Conversation quotidienne | 4.64 ⭐ |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from peft import PeftModel
import torch
base = AutoModelForSeq2SeqLM.from_pretrained(
"facebook/nllb-200-3.3B",
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(base, "VOTRE_USERNAME/nllb-fra-tzm-v2")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-3.3B")
def traduire(texte):
tokenizer.src_lang = "fra_Latn"
inputs = tokenizer(texte, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids("tzm_Tfng"),
max_length=128,
num_beams=5
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
print(traduire("Le tamazight est une langue berbère"))
| Français | Tamazight (Tifinagh) |
|---|---|
| Le tamazight est une langue berbère | ⵜⴰⵎⴰⵣⵉⵖⵜ ⴷ ⵜⵓⵜⵍⴰⵢⵜ ⵜⴰⵢⵎⵎⴰⵜ |
| Le Dimanche 18 Décembre | ⴰⵛ ⴻⵔ 18 ⵓⵡⴰⵏⴱⵉⵔ |
CC-BY-NC-4.0