Downloads · 30 days
3
15% of all-time downloads
bazik-0/indictrans2-en-kas-finetuned-200M-5
indictrans2-en-kas-finetuned-200M-5 is a translation model from bazik-0. Use it when you need text moved from one language to another. It is set up for peft. The card lists the license as apache-2.0.
A LoRA fine-tune of IndicTrans2 (distilled 200M, en-indic) for English → Kashmiri translation, with Kashmiri output in the Perso-Arabic script (kasArab).
Downloads · 30 days
3
15% of all-time downloads
All-time downloads
20
Public
Repo size
11.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors7.1 MB · 41%
From the Hugging Face model README
A LoRA fine-tune of IndicTrans2 (distilled 200M, en-indic) for English → Kashmiri translation, with Kashmiri output in the Perso-Arabic script (kas_Arab).
IndicTrans2 is AI4Bharat's open-source neural MT model covering English and 22 scheduled Indian languages. This checkpoint takes the distilled 200M en→indic variant and adapts it specifically to Kashmiri using LoRA adapters trained on the kas_Arab portion of the BPCC parallel corpus, merged back into the base weights.
ai4bharat/indictrans2-en-indic-dist-200Meng_Latn)kas_Arab)Sentence-level English → Kashmiri translation. Intended for research, low-resource MT experimentation, and applications needing Kashmiri text output in the Perso-Arabic script. Not intended for high-stakes use (legal, medical) without human review — see Limitations below.
This model requires IndicTransToolkit for the pre/post-processing IndicTrans2 expects (language tags, script normalization).
pip install transformers accelerate sentencepiece
git clone https://github.com/VarunGumma/IndicTransToolkit.git
pip install --editable ./IndicTransToolkit
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from IndicTransToolkit.IndicTransToolkit import IndicProcessor
MODEL_ID = "bazik-0/indictrans2-en-kas-finetuned-200M-5"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_ID, trust_remote_code=True, torch_dtype=torch.float32)
model.eval()
ip = IndicProcessor(inference=True)
sentences = ["Hello, how are you?", "The weather is very cold today."]
processed = ip.preprocess_batch(sentences, src_lang="eng_Latn", tgt_lang="kas_Arab")
inputs = tokenizer(processed, return_tensors="pt", padding=True, truncation=True, max_length=128)
with torch.no_grad():
outputs = model.generate(**inputs, max_length=128, num_beams=5, early_stopping=True)
decoded = tokenizer.batch_decode(outputs, skip_special_tokens=True)
translations = ip.postprocess_batch(decoded, lang="kas_Arab")
print(translations)
| English | Kashmiri |
|---|---|
| She was a true visionary. | سہٕ ٲس اکھ حقیقی نظریہ ساز۔ |
| I go to my school daily. | بہٕ چھس پرٛؠتھ دۄہ پننس سکولس منٛز گژھان۔ |
| Nobody know whence he has come. | کٲنہہ تہ چھنہٕ زانان سہ کتہ پؠٹھ چھ آمت۔ |
Fine-tuned on ai4bharat/BPCC (bpcc-seed-latest config), kas_Arab subset — 90,000 training pairs and 8,929 held-out eval pairs, shuffled with seed 42.
Source and target text is passed through IndicTransToolkit's IndicProcessor for IndicTrans2's language-tag formatting and script normalization before tokenization. Sequences are truncated to a max length of 128 tokens.
LoRA adapters (via PEFT) trained on the attention projections with the base model frozen, then merged into the base weights for release:
r=16, alpha=32, dropout 0.05q_proj, v_projHyperparameters:
| Param | Value |
|---|---|
| Epochs | 8 |
| Per-device batch size | 16 |
| Gradient accumulation | 8 (effective batch 128) |
| Learning rate | 5e-5 |
| Weight decay | 0.01 |
| Warmup ratio | 0.03 |
| Precision | bf16 |
| Optimizer | AdamW |
| Max grad norm | 1.0 |
Compute: single Kaggle T4 GPU, via 🤗 Seq2SeqTrainer.
Metric: BLEU (sacrebleu), computed on the held-out eval split.
Result: 6.07 BLEU on the target evaluation set.
kas_Arab (Perso-Arabic script); it does not support Kashmiri written in Devanagari.If you use this model, please cite the base IndicTrans2 work:
@article{gala2023indictrans2,
title = {IndicTrans2: Towards High-Quality and Accessible Machine Translation Models for all 22 Scheduled Indian Languages},
author = {Jay Gala and Pranjal A. Chitale and A K Raghavan and Varun Gumma and Sumanth Doddapaneni and Aswanth Kumar M and Janki Atul Nawale and Anupama Sujatha and Ratish Puduppully and Vivek Raghavan and Pratyush Kumar and Mitesh M. Khapra and Raj Dabre and Anoop Kunchukuttan},
journal = {arXiv preprint arXiv:2305.16307},
year = {2023}
}
Open a discussion on this model's Hugging Face repo for questions.