SetuNLP IndicTrans2 LoRA for Dogri and Punjabi Translation
2 min readupdated
This pair of independent LoRA adapters (small add-ons for weight fine-tuning) fine-tunes the IndicTrans2-1B model for high-quality bidirectional translation between Dogri (doi) and Punjabi (pa). Built on a 1-billion-parameter multilingual architecture, the model was trained on a thoroughly cleaned corpus from the SetuNLP project. The solution delivers a noticeable boost in translation accuracy and is built for regional language researchers and translation system developers.
Key features
- Two independent adapters for bidirectional translation (Dogri ⇄ Punjabi).
- Trained on a filtered dataset of 23,000 clean sentence pairs.
- Seamless integration via the standard transformers and PEFT library stack.
What you can do
- Set up automated text translation between Dogri and Punjabi in research pipelines.
- Plug the adapters into the base IndicTrans2-1B model for local NLP tasks.
Example
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from peft import PeftModel
BASE = "ai4bharat/indictrans2-indic-indic-1B"
REPO = "rishitkar/SetuNLP-indictrans2-1B-doi-pun-LoRA"
DIRECTION = "doi2pan"
tokenizer = AutoTokenizer.from_pretrained(BASE, trust_remote_code=True)
base = AutoModelForSeq2SeqLM.from_pretrained(BASE, trust_remote_code=True, torch_dtype=torch.float16)
model = PeftModel.from_pretrained(base, REPO, subfolder=DIRECTION).to("cuda").eval()
print("Model loaded successfully!")
Read more
DetailsTest set metrics: for doi→pan BLEU 52.93 (+7.63), chrF++ 65.15.
For pan→doi BLEU 46.38 (+7.58), chrF++ 58.75.
Training: LoRA rank 96, alpha 128 on an NVIDIA Tesla T4 GPU.
Requirements: fp16 support, transformers and peft libraries.










Comments