Practical overview
When it fits
Use it when building a Python workflow around supported IndicTrans2-family models and you need the toolkit’s batch preprocessing, output post-processing, or evaluation utilities.
Who it is for
- Developers integrating IndicTrans2 model support into applications or translation workflows.
- Practitioners preparing batches for model inference and normalizing decoded translations.
- Teams evaluating translation predictions against reference text.
Documented uses
- Prepare sentence batches using source and target language codes before model tokenization.
- Post-process decoded model outputs, including batches with multiple generated sequences when configured accordingly.
- Calculate BLEU and ChrF2++ scores from prediction and reference files or lists.
Requirements & limits
The repository is public and MIT-licensed. Setup documentation specifies Python 3.10+ and Linux or macOS; Windows is not currently intended, built, or tested.
- The toolkit supports model-side workflow components; the README example loads the model and tokenizer separately.
- The repository recommends numpy 2.1+, torch 2.5+, and transformers 4.51+ and does not guarantee stability below those versions.
- The project reports that IndicEvaluator can produce slightly lower scores than the original IndicTrans2 evaluation script.
- For generation with multiple return sequences, the matching count must also be passed to postprocess_batch.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare model input and post-process translated output
Use IndicProcessor around a Hugging Face IndicTrans2 model generation workflow.
Before you start
- Python 3.10 or later on Linux or macOS
- Indictranstoolkit, torch, transformers, and a compatible Hugging Face IndicTrans2 model and tokenizer
- A batch of source sentences and source and target language codes
Steps
Create
IndicProcessor(inference=True)and load the model and tokenizer with the Hugging Face APIs shown in the README.Call
preprocess_batchwith the sentences and source and target language codes.Tokenize the processed batch, generate model outputs, and decode them with the tokenizer.
Pass decoded outputs to
postprocess_batchwith the target language code.
Expected outcome
A list of post-processed translations, as illustrated in the README’s English-to-Hindi example.
Guide limitations
- The guide follows the repository’s example and does not establish performance or compatibility for other environments or models.
- If generation uses more than one return sequence, the README says to set the corresponding
num_return_sequencesvalue inpostprocess_batch.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- VarunGumma/IndicTransToolkit · Official homepage title · retained in its source language

