GigaAM-v3 ONNX — Russian Speech Recognition
GigaAM-v3 (222.5M params) exported to ONNX with Int8 quantization. CER ~4-5%, RTF ~0.04 on CPU (25× faster than real time).
Quick Start
pip install onnxruntime numpy torch torchaudio soundfile pandas
python3 recognize.py speech.wav
Result: "В древнем Китае использовали уникальный способ обозначения периодов времени."
Знаки препинания (заглавные буквы, запятые, точки) восстанавливаются автоматически через Silero TE model (скачивается при первом запуске).
Без пунктуации: --no-punct
Model Files
| File | Size | Description |
|---|---|---|
model/gigaam_v3_rnnt_encoder.onnx |
305 MB | Conformer encoder (Int8) |
model/gigaam_v3_rnnt_decoder.onnx |
3.2 MB | LSTM decoder |
model/gigaam_v3_rnnt_joint.onnx |
1.4 MB | Joint network |
model/gigaam_v3_rnnt_tokens.txt |
195 B | Token vocabulary (33 chars + blank) |
Architecture
- Encoder: Conformer 16 layers, 768 dim (222M params)
- Decoder: LSTM 1 layer, 320 dim + Embedding (34→320)
- Joint: 2× Linear(768→320, 320→320) + ReLU + Linear(320→34)
- Vocabulary: 33 Russian letters + space +
<blk>
Performance
| Metric | Value |
|---|---|
| Params | 222.5M |
| CER (test set) | ~4.9% |
| RTF (CPU, FP32) | 0.04 |
| RTF (CPU, Int8) | 0.03 |
| Avg decode (12s audio) | ~450 ms (FP32) / ~320 ms (Int8) |
Usage
Command Line
# Recognize a WAV file (16kHz, mono)
python3 recognize.py speech.wav
# Benchmark
python3 recognize.py --benchmark
Python API
from recognize import GigaAMRecognizer
asr = GigaAMRecognizer('model')
# From file
text = asr.transcribe('speech.wav')
# From numpy array (16kHz, mono)
import soundfile as sf
audio, sr = sf.read('speech.wav')
text = asr.transcribe_raw(audio)
print(text) # "эта идея пришла из китая где излюбленным цветком был цвет сливы"
GUI (offline ASR app)
python3 asr_gui.py
Buttons: 🎤 Start / ⏹ Stop. Text is copied to clipboard automatically.
Requirements
- Python 3.10+
onnxruntime(oronnxruntime-gpufor GPU)numpytorch,torchaudio(for mel spectrogram)soundfilepandas(optional, for dataset evaluation)- Silero punctuation model (auto-downloaded via torch.hub, ~87MB)
License
MIT. The underlying GigaAM-v3 model is from ai-sage/GigaAM-v3.
Citation
@software{gigaam_v3_onnx,
title = {GigaAM-v3 ONNX: Russian Speech Recognition},
author = {Sber AI},
year = {2024},
url = {https://huggingface.co/ai-sage/GigaAM-v3}
}