Downloads · 30 days
16
17% of all-time downloads
hari31416/indictrans2-indic-en-1B-ONNX-fp16
indictrans2-indic-en-1B-ONNX-fp16 is a translation model from hari31416. Use it when you need text moved from one language to another. It is set up for onnx. The card lists the license as mit.
[!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-indic-en-1B-ONNX - FP16 (Half Precis…
Downloads · 30 days
16
17% of all-time downloads
All-time downloads
96
Public
Repo size
5.1 GB
Likes
0
Public
Click a slice to open those files.
.data2 GB · 98%
From the Hugging Face model README
[!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-indic-en-1B-ONNX- FP16 (Half Precision):
hari31416/indictrans2-indic-en-1B-ONNX-fp16(Current)- INT8 (Dynamic Quantization):
hari31416/indictrans2-indic-en-1B-ONNX-int8- Q4F16 (4-bit Block Quantization):
hari31416/indictrans2-indic-en-1B-ONNX-q4f16
ONNX-exported and quantized version of ai4bharat/indictrans2-indic-en-1B
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.
| Format | Model Size | Exact Match (Token) | Exact Match (Text) | SacreBLEU (Raw) | Latency (Mean) | Speedup vs. FP32 |
|---|---|---|---|---|---|---|
| FP32 | 4.88 GB | 100.00% | 100.00% | 100.00 | 49.0 ms | 1.000x |
| FP16 | 2.44 GB | 99.82% | 99.82% | 99.96 | 49.7 ms | 0.987x |
| INT8 | 1.22 GB | 94.45% | 94.45% | 98.00 | 25.2 ms | 1.900x |
| Q4F16 | 625.0 MB | 88.55% | 88.55% | 95.44 | 42.7 ms | 1.080x |
Exact match rates and translation quality (SacreBLEU / chrF) per language pair under this precision:
| Language Code | Total Fixtures | Token Match Rate | Text Match Rate | SacreBLEU | SacreBLEU (chrF) |
|---|---|---|---|---|---|
| eng_Latn | 1100 | 99.8% | 99.8% | 99.96 | 99.97 |
Exact match rates and translation quality grouped by category types:
| Category | Total Fixtures | Token Match Rate | Text Match Rate | SacreBLEU | SacreBLEU (chrF) |
|---|---|---|---|---|---|
| Generic | 286 | 100.0% | 100.0% | 100.00 | 100.00 |
| Lexicon | 264 | 99.6% | 99.6% | 99.92 | 99.94 |
| Numerals | 264 | 99.6% | 99.6% | 99.92 | 99.95 |
| Politics | 286 | 100.0% | 100.0% | 100.00 | 100.00 |
Here is a sample of up to 5 translation mismatches compared to the FP32 oracle. Many mismatches represent minor synonym differences or spacing variations.
চিকিৎসালয়খনে 24 ঘণ্টা জৰুৰীকালীন চিকিৎসা সেৱা প্ৰদান কৰে।The hospital provides 24-hour emergency medical care.The hospital provides 24-hour emergency medical services.ओह् अपनी गाड़ी लेई दफतर तक्कर गेआ।He took his car to the office.He drove his car to the office.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)# translate.py is included in this repo alongside the ONNX bundle.
# You can also find it (and read the full source) at:
# https://github.com/Hari31416/indictrans2-onnx-export/blob/main/src/translate.py
from translate import IndicTransONNX
# Pass a HF repo ID for automatic download, or a local bundle directory path
model = IndicTransONNX("hari31416/indictrans2-indic-en-1B-ONNX-fp16")
print(model.translate("चुनाव कौन जीतेगा?", src_lang="hin_Deva", tgt_lang="eng_Latn"))
Required packages:
pip install onnxruntime tokenizers huggingface-hub
MIT (preserved from upstream AI4Bharat).