Downloads · 30 days
6
12% of all-time downloads
hectordiazgomez/nllb-spa-awa-v2
nllb-spa-awa-v2 is a machine learning model from hectordiazgomez. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
51
Public
Repo size
7.4 GB
Likes
1
Public
Click a slice to open those files.
.bin2.5 GB · 100%
From the Hugging Face model README
Key metrics:
BLEU score: 15.26
Individual n-gram precisions:
sample_implementation:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
def translate(text, src_lang='spa_Latn', tgt_lang='awa_Latn', max_input_length=1024, num_beams=4, **kwargs):
tokenizer.src_lang = src_lang
tokenizer.tgt_lang = src_lang
inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True, max_length=max_input_length)
model.eval()
result = model.generate(
**inputs,
forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),
num_beams=num_beams,
**kwargs
)
return tokenizer.batch_decode(result, skip_special_tokens=True)
model_name = "hectordiazgomez/nllb-spa-awa-v2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
text = 'Hola a todos mis amigos' #Hello to all my friends
translated_text = translate(text, 'spa_Latn', 'awa_Latn')
print(translated_text)
license: Research Use Only License
copyright: Copyright (c) 2024 Hector Alberto Diaz Gomez
grant: It is a Spanish to Awajun translator and permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, and modify the Software for non-commercial research purposes only, subject to the following conditions:
conditions: