๐ฎ๐ณ BharatBhasha AI - Machine Translation (T2T) Models
Production-grade, INT8-quantized ONNX neural machine translation packages for AI4Bharat IndicTrans2, specifically optimized for offline deployment on Android mobile devices and edge environments.
๐ฆ Model Artifacts & Architecture
| Model Bundle | Direction | Languages Supported | Size | Format |
|---|---|---|---|---|
indictrans2-en-indic-dist-200M-ONNX-int8 |
English โ Indic | 22 Scheduled Indian Languages | ~235 MB | INT8 ONNX |
indictrans2-indic-en-dist-200M-ONNX-int8 |
Indic โ English | 22 Scheduled Indian Languages | ~235 MB | INT8 ONNX |
indictrans2-indic-indic-dist-320M-ONNX-int8 |
Indic โ Indic | Any pair among 22 Languages | ~325 MB | INT8 ONNX |
Bundle Contents
Each model directory includes:
encoder_model.onnx: Quantized INT8 transformer encoderdecoder_model.onnx: Initial token decoderdecoder_with_past_model.onnx: Optimized decoder with past KV-cache reuse for low-latency generationdict.SRC.json,dict.TGT.json: Vocabulary mapsmodel.SRC,model.TGT: SentencePiece tokenizer modelstokenizer_src.json,tokenizer_tgt.json: HuggingFace Fast Tokenizers
๐ฑ Mobile Android Deployment (ONNX Runtime Mobile)
Add to build.gradle.kts:
dependencies {
implementation("com.microsoft.onnxruntime:onnxruntime-android:1.20.0")
}
Load the session with hardware acceleration:
val env = OrtEnvironment.getEnvironment()
val sessionOpts = OrtSession.SessionOptions().apply {
addNnapi() // Android Neural Networks API acceleration
setIntraOpNumThreads(4)
}
val encoderSession = env.createSession(encoderFile.absolutePath, sessionOpts)
โก Inference Benchmarks
- Encoder Latency (Mobile CPU/NNAPI): ~85ms
- Decoder Latency Per Token: ~28ms
- RAM Footprint: ~160 MB (Comfortably runs on 3GBโ4GB budget Android phones)