Downloads · 30 days
14
7% of all-time downloads
CenIA/nllb-200-3.3B-spa-arn
nllb-200-3.3B-spa-arn is a translation model from CenIA. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
Finetuned facebook/nllb-200-3.3B model to translate between Spanish ("spaLatn") and Mapuzungún. We support the following languages/graphemaries: - Spanish (spaLatn) - Azümchefe (quyLatn) - Ragileo (nsoLatn) - Unificad…
Downloads · 30 days
14
7% of all-time downloads
All-time downloads
193
Public
Repo size
26.4 GB
Likes
0
Public
Click a slice to open those files.
.bin6.7 GB · 100%
From the Hugging Face model README
Finetuned facebook/nllb-200-3.3B model to translate between Spanish ("spa_Latn") and Mapuzungún. We support the following languages/graphemaries:
from transformers import NllbTokenizerFast, AutoModelForSeq2SeqLM
tokenizer = NllbTokenizerFast.from_pretrained("CenIA/nllb-200-3.3B-spa-arn")
model = AutoModelForSeq2SeqLM.from_pretrained("CenIA/nllb-200-3.3B-spa-arn")
def translate(sentence: str, translate_from="spa_Latn", translate_to="quy_Latn") -> str:
tokenizer.src_lang = translate_from
tokenizer.tgt_lang = translate_to
inputs = tokenizer(sentence, return_tensors="pt")
result = model.generate(**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids(translate_to))
decoded = tokenizer.batch_decode(result, skip_special_tokens=True)[0]
return decoded
traduction = translate("Hola, ¿cómo estás?")
print(traduction)