Views
No views yet
[!TIP] This model is part of a suite of optimized/quantized ONNX versions of the base model. Other variants in this direction:
- FP32 (Full Precision / Base):
hari31416/indictrans2-en-indic-1B-ONNX- FP16 (Half Precision):
hari31416/indictrans2-en-indic-1B-ONNX-fp16- INT8 (Dynamic Quantization):
hari31416/indictrans2-en-indic-1B-ONNX-int8(Current)- Q4F16 (4-bit Block Quantization):
hari31416/indictrans2-en-indic-1B-ONNX-q4f16
ai4bharat/indictrans2-en-indic-1B
for in-browser and local edge inference.


| Format | Model Size | Exact Match (Token) | Exact Match (Text) | SacreBLEU (Raw) | Latency (Mean) | Speedup vs. FP32 |
|---|---|---|---|---|---|---|
| FP32 | 6.64 GB | 100.00% | 100.00% | 100.00 | 69.5 ms | 1.000x |
| FP16 | 3.32 GB | 99.73% | 99.73% | 100.00 | 74.3 ms | 0.935x |
| INT8 | 1.66 GB | 89.55% | 89.55% | 96.27 | 31.4 ms | 2.125x |
| Q4F16 | 850.5 MB | 82.45% | 82.55% | 91.99 | 58.4 ms | 1.186x |
| Language Code | Total Fixtures | Token Match Rate | Text Match Rate | SacreBLEU | SacreBLEU (chrF) |
|---|---|---|---|---|---|
| asm_Beng | 50 | 92.0% | 92.0% | 97.28 | 98.99 |
| ben_Beng | 50 | 92.0% | 92.0% | 94.53 | 97.99 |
| brx_Deva | 50 | 80.0% | 80.0% | 91.68 | 97.20 |
| doi_Deva | 50 | 86.0% | 86.0% | 95.99 | 97.67 |
| gom_Deva | 50 | 94.0% | 94.0% | 96.83 | 99.47 |
| guj_Gujr | 50 | 90.0% | 90.0% | 96.73 | 98.74 |
| hin_Deva | 50 | 98.0% | 98.0% | 98.94 | 99.63 |
| kan_Knda | 50 | 88.0% | 88.0% | 94.90 | 98.17 |
| kas_Arab | 50 | 92.0% | 92.0% | 95.75 | 97.49 |
| mai_Deva | 50 | 92.0% | 92.0% | 95.54 | 98.14 |
| mal_Mlym | 50 | 100.0% | 100.0% | 100.00 | 100.00 |
| mar_Deva | 50 | 92.0% | 92.0% | 96.04 | 98.67 |
| mni_Beng | 50 | 72.0% | 72.0% | 84.69 | 92.04 |
| npi_Deva | 50 | 96.0% | 96.0% | 97.29 | 98.64 |
| ory_Orya | 50 | 90.0% | 90.0% | 94.87 | 98.94 |
| pan_Guru | 50 | 92.0% | 92.0% | 96.78 | 98.32 |
| san_Deva | 50 | 76.0% | 76.0% | 86.50 | 96.14 |
| sat_Olck | 50 | 66.0% | 66.0% | 83.16 | 90.39 |
| snd_Arab | 50 | 96.0% | 96.0% | 97.47 | 98.96 |
| tam_Taml | 50 | 94.0% | 94.0% | 96.50 | 98.95 |
| tel_Telu | 50 | 94.0% | 94.0% | 97.87 | 98.64 |
| urd_Arab | 50 | 98.0% | 98.0% | 99.36 | 99.69 |
| Category | Total Fixtures | Token Match Rate | Text Match Rate | SacreBLEU | SacreBLEU (chrF) |
|---|---|---|---|---|---|
| Generic | 286 | 87.1% | 87.1% | 93.24 | 96.89 |
| Lexicon | 264 | 89.4% | 89.4% | 95.02 | 97.75 |
| Numerals | 264 | 90.5% | 90.5% | 95.92 | 98.21 |
| Politics | 286 | 91.3% | 91.3% | 95.94 | 98.11 |
She sang a beautiful song at the concert.কনচাৰ্টটোত তেওঁ এটা সুন্দৰ গীত গাইছিল।কনচাৰ্টখনত তেওঁ এটা সুন্দৰ গীত গাইছিল।The books are arranged on the shelf in alphabetical order.কিতাপবোৰ বৰ্ণানুক্রমিক ক্ৰমত তাকত সজোৱা হয়।কিতাপবোৰ বৰ্ণানুক্রমিকভাৱে তাকত সজোৱা হয়।A warm cup of tea is perfect for a cold morning.এক গৰম কাপ চাহ ঠাণ্ডা ৰাতিপুৱাৰ বাবে উপযুক্ত।ঠাণ্ডা ৰাতিপুৱাৰ বাবে এক গৰম কাপ চাহ উপযুক্ত।The price of gold has reached a new high.সোণৰ মূল্য নতুন উচ্চতাত উপনীত হৈছে।সোণৰ মূল্য এক নতুন উচ্চতাত উপনীত হৈছে।The quick brown fox jumps over the lazy dog.দ্রুত বাদামী শিয়াল অলস কুকুরের উপর ঝাঁপিয়ে পড়ে।দ্রুত বাদামী শিয়ালটি অলস কুকুরটির উপর ঝাঁপিয়ে পড়ে।encoder_model.onnx (and optional .onnx.data weights sidecar)decoder_model.onnx and decoder_with_past_model.onnx (share decoder_shared.onnx.data when present)translate.py — self-contained Python inference helper (see Usage below)tokenizer_src.json, tokenizer_tgt.json, tokenizer_meta.json)config.json, generation_config.json)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-en-indic-1B-ONNX-int8")
9print(model.translate("Who will win the election?", src_lang="eng_Latn", tgt_lang="hin_Deva"))pip install onnxruntime tokenizers huggingface-hub