NLLB Telugu ↔ Gondi (exp2_synth_all)
Fine-tuned from facebook/nllb-200-1.3B with LoRA on gold post-edited + synthetic Telugu–Gondi (Adilabad) parallel data.
Supports bidirectional translation: tel_Telu ↔ wsg_Telu.
Evaluation scores (test set, 500 pairs)
| Direction | chrF++ | BLEU |
|---|
Telugu → Gondi (tel_Telu → wsg_Telu) | 40.76 | 21.50 |
Gondi → Telugu (wsg_Telu → tel_Telu) | 52.16 | 32.65 |
Language codes
| Language | NLLB code |
|---|
| Telugu | tel_Telu |
| Gondi (Adilabad) | wsg_Telu |
Training data
| Source | Pairs |
|---|
| Gold (human post-edited) | 25,706 |
| Synthetic (all) | 72,164 |
| Total (× 2 directions) | 195,740 |
Inference
Install dependencies
pip install transformers torch sentencepiece
Telugu → Gondi
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
model_id = "vishnu-vizz/nllb_telgon_exp2_synth_all_20260804_201845"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
model.eval()
def translate(text, src_lang, tgt_lang):
tokenizer.src_lang = src_lang
tgt_token_id = tokenizer.convert_tokens_to_ids(tgt_lang)
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256).to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
forced_bos_token_id=tgt_token_id,
max_new_tokens=256,
num_beams=10,
no_repeat_ngram_size=3,
early_stopping=True,
)
return tokenizer.decode(output[0], skip_special_tokens=True)
# Telugu → Gondi
print(translate("నీళ్ళు తాగండి", src_lang="tel_Telu", tgt_lang="wsg_Telu"))
# Gondi → Telugu
print(translate("నీళ్ తాగ్వల్", src_lang="wsg_Telu", tgt_lang="tel_Telu"))
Batch inference
def translate_batch(sentences, src_lang, tgt_lang, batch_size=16):
tokenizer.src_lang = src_lang
tgt_token_id = tokenizer.convert_tokens_to_ids(tgt_lang)
results = []
for i in range(0, len(sentences), batch_size):
batch = sentences[i : i + batch_size]
inputs = tokenizer(
batch, return_tensors="pt", truncation=True,
max_length=256, padding=True,
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
forced_bos_token_id=tgt_token_id,
max_new_tokens=256,
num_beams=10,
no_repeat_ngram_size=3,
early_stopping=True,
)
results.extend(tokenizer.batch_decode(outputs, skip_special_tokens=True))
return results
sentences = ["నీళ్ళు తాగండి", "మీ పేరు ఏమిటి?"]
print(translate_batch(sentences, src_lang="tel_Telu", tgt_lang="wsg_Telu"))
CPU inference (no GPU)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, torch_dtype=torch.float32)
Citation
If you use this model, please cite the base model:
@article{costa2022no,
title={No language left behind: Scaling human-centered machine translation},
author={Costa-juss{\`a}, Marta R and others},
journal={arXiv preprint arXiv:2207.04672},
year={2022}
}