Edit model card

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
20
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.

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

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