ONNX-exported and quantized version of
ai4bharat/indictrans2-indic-en-dist-200M
for in-browser and local edge inference.
Built for use with
Transformers.js
and
onnxruntime-web
in the browser, with fast BPE tokenizer.json files that don't require the
SentencePiece WASM runtime.
These charts show overall tradeoffs, language-level parity, and category breakdown.
Compared against the FP32 ONNX oracle on the golden evaluation fixtures.
Exact match rates and translation quality (SacreBLEU / chrF) per language pair under this precision:
Here is a sample of up to 5 translation mismatches compared to the FP32 oracle. Many mismatches represent minor synonym differences or spacing variations.
1# translate.py is included in this repo alongside the ONNX bundle.
2# You can also find it (and read the full source) at:
3# https://github.com/Hari31416/indictrans2-onnx-export/blob/main/src/translate.py
4
5from translate import IndicTransONNX
6
7# Pass a HF repo ID for automatic download, or a local bundle directory path
8model = IndicTransONNX("hari31416/indictrans2-indic-en-dist-200M-ONNX-fp16")
9print(model.translate("चुनाव कौन जीतेगा?", src_lang="hin_Deva", tgt_lang="eng_Latn"))
MIT (preserved from upstream AI4Bharat).