Indic Conformer ASR - INT8 Quantized ONNX Models
Quantized version of AI4Bharat's Indic Conformer 600M multilingual ASR model for efficient on-device inference.
📋 Model Details
- Original Model: ai4bharat/indic-conformer-600m-multilingual
- Quantization: INT8 (via ONNX Runtime quantization)
- Framework: ONNX Runtime
- Languages: 23 Indian languages (Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Oriya, Assamese, Sanskrit, and more)
- Use Case: Offline speech recognition on mobile/edge devices
🗂️ Files Included
Core Models
encoder_int8.onnx (622 MB) - Quantized Conformer encoder
- Input: Log-mel spectrogram features [1, 80, T]
- Output: Encoded features [1, 1024, T_sub]
ctc_decoder_int8.onnx (5.5 MB) - Quantized CTC decoder
- Input: Encoded features [1, T_sub, 1024]
- Output: Log probabilities [1, T_sub, 5633]
Supporting Files
vocab.json - Per-language vocabularies (257 tokens each)
language_indices.json - CTC vocab masking indices for language-specific decoding
mel_filters.json - Mel filterbank (257 x 80)
hanning_window.json - Hanning window for STFT (400 samples)
📊 Compression Stats
| Model | Original (FP32) | Quantized (INT8) | Reduction |
|---|
| Encoder | ~2.5 GB | 622 MB | ~75% |
| Decoder | ~22 MB | 5.5 MB | ~75% |
| Total | ~2.52 GB | 627.5 MB | ~75% |
🚀 Quick Start
Python (ONNX Runtime)
1import onnxruntime as ort
2import numpy as np
3import json
4
5# Load models
6encoder_session = ort.InferenceSession("encoder_int8.onnx")
7decoder_session = ort.InferenceSession("ctc_decoder_int8.onnx")
8
9# Load vocabularies
10with open("vocab.json") as f:
11 vocab = json.load(f)
12with open("language_indices.json") as f:
13 language_indices = json.load(f)
14
15# Prepare audio features (log-mel spectrogram)
16# features shape: [1, 80, T]
17features = extract_mel_features(audio, sample_rate=16000)
18length = np.array([[features.shape[2]]], dtype=np.int64)
19
20# Run encoder
21encoder_output = encoder_session.run(
22 ["outputs"],
23 {"input": features, "length": length}
24)[0]
25
26# Run decoder
27logprobs = decoder_session.run(
28 ["logprobs"],
29 {"encoder_output": encoder_output}
30)[0]
31
32# Greedy CTC decoding with language-specific masking
33language = "hin" # Hindi
34active_indices = language_indices[language]
35vocab_list = vocab[language]
36
37transcript = ""
38prev_idx = -1
39for t in range(logprobs.shape[1]):
40 #Get argmax among active vocab indices
41 scores = logprobs[0, t, active_indices]
42 max_idx = np.argmax(scores)
43
44 # CTC deduplication
45 if max_idx != 256 and max_idx != prev_idx: # 256 is blank
46 transcript += vocab_list[max_idx]
47 prev_idx = max_idx
48
49print(transcript)
🎯 Supported Languages
23 Indian languages including Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Odia, Assamese, Sanskrit, Urdu, Dogri, Konkani, Maithili, Manipuri, Nepali, Santali, and Sindhi.
📐 Model Architecture
Audio (16kHz)
↓
Mel Spectrogram (80 bins)
↓
Conformer Encoder (24 layers, 600M params)
↓ [1, 1024, T_sub]
CTC Decoder
↓ [1, T_sub, 5633]
Language-specific masking
↓
Greedy/Beam Search
↓
Transcription
⚙️ Performance
Tested on Android (Pixel 7):
- Encoder: ~200-500ms for 3-5 second audio
- Decoder: ~10-50ms
- Total latency: ~250-550ms end-to-end
- Memory: ~800MB peak
📝 Citation
1@article{conformer2023,
2 title={Scaling Speech Technology to 1000+ Languages},
3 author={AI4Bharat},
4 journal={arXiv preprint},
5 year={2023}
6}
🏗️ Original Creators
📄 License
Same as original model (check AI4Bharat's repository for licensing terms)
Quantized for mobile deployment | January 2026