This repository contains fully self-contained standard Python scripts designed to run perfectly on Lightning AI GPU studios (and any standard PyTorch GPU environment).
First, ensure you have the required libraries installed:
pip install -r requirements.txt
The dataset preparation script iterates through all matched domains in the Bengali and Hindi folders to create parallel sentence pairs. It automatically removes any blank lines and mismatched files, converting everything to a unified Hugging Face dataset.
To run the split (80% training / 20% testing):
python prepare_data.py
This will generate a hf_dataset folder containing the train/test splits.
To fine-tune the ai4bharat/indictrans2-indic-indic-dist-320M model:
python train_indictrans2.py
This handles tokenization, training, memory usage optimization natively via HF Trainer, and executes a full testing evaluation step automatically after the training is concluded.
To fine-tune the facebook/nllb-200-distilled-600M model:
python train_nllb.py
This similarly leverages your local datasets, assigns correct specific language metrics (ben_Beng & hin_Deva), and outputs a completely evaluated model checkpoint ready for downstream use.
hf_dataset/indictrans2_finetuned_bn_hi/nllb_finetuned_bn_hi/4 commits
Jupyter Notebook
90.9%
Python
5.5%
HTML
2.7%
This repository contains fully self-contained standard Python scripts designed to run perfectly on Lightning AI GPU studios (and any standard PyTorch GPU environment).
First, ensure you have the required libraries installed:
pip install -r requirements.txt
The dataset preparation script iterates through all matched domains in the Bengali and Hindi folders to create parallel sentence pairs. It automatically removes any blank lines and mismatched files, converting everything to a unified Hugging Face dataset.
To run the split (80% training / 20% testing):
python prepare_data.py
This will generate a hf_dataset folder containing the train/test splits.
To fine-tune the ai4bharat/indictrans2-indic-indic-dist-320M model:
python train_indictrans2.py
This handles tokenization, training, memory usage optimization natively via HF Trainer, and executes a full testing evaluation step automatically after the training is concluded.
To fine-tune the facebook/nllb-200-distilled-600M model:
python train_nllb.py
This similarly leverages your local datasets, assigns correct specific language metrics (ben_Beng & hin_Deva), and outputs a completely evaluated model checkpoint ready for downstream use.
hf_dataset/indictrans2_finetuned_bn_hi/nllb_finetuned_bn_hi/4 commits
Jupyter Notebook
90.9%
Python
5.5%
HTML
2.7%