What Is This?

It is a NLLB-200-600M model fine-tuned for translating between englih and sinhala languages

Training & Inference Codes - https://github.com/zaanind/NLLB-200-Sinhala

Try It

How to use the model:

1.Install necessary libraries

pip install  requests sentencepiece transformers==4.33 sacremoses  sacrebleu

2.Translate!

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch


model_name = "zaanind/nllb-ensi-v1-tuning"  #download model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)


def dotranslate(text): #define function for generation
  inputs = tokenizer(text, return_tensors="pt")
  translated_tokens = model.generate(**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["sin_Sinh"])
  out = tokenizer.decode(translated_tokens[0], skip_special_tokens=True)

  return out


dotranslate("hello how are you?") #translate

Contact - https://t.me/zaanind

Downloads last month
25
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.

Datasets used to train zaanind/nllb-ensi-v1.6

Space using zaanind/nllb-ensi-v1.6 1