Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Key metrics:

BLEU score: 15.26

Individual n-gram precisions:

  • 1-gram precision: 32.3%
  • 2-gram precision: 23.6%
  • 3-gram precision: 15.3%
  • 4-gram precision: 10.6%

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:

  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  • The Software may not be used for any commercial purposes, including without limitation, any use in a commercial product or service, or any use in a product or service that generates revenue.
  • Any publication or presentation that uses the Software must include a citation to the original work and acknowledge the use of this Software.
  • The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software.
Downloads last month
2
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.