aystream's picture
Upload GigaAM-Multilingual-v2 MLX weights, tokenizer, config, and model card
7b1658a verified
|
Raw History Blame Contribute Delete
3.43 kB
---
license: mit
base_model: ai-sage/GigaAM-Multilingual-v2
pipeline_tag: automatic-speech-recognition
library_name: mlx
tags:
- mlx
- apple-silicon
- asr
- speech-recognition
- gigaam
- zapformer
- multilingual
- streaming
language:
- ru
- en
- kk
- ky
- uz
- be
- fr
- es
- ba
- ka
- hy
- ro
- tk
- az
- tg
- de
- it
- nl
- pl
- pt
- tt
---
# GigaAM-Multilingual-v2-mlx
Pure Apple MLX conversion of [`ai-sage/GigaAM-Multilingual-v2`](https://huggingface.co/ai-sage/GigaAM-Multilingual-v2) (`rnnt` branch) for [gigaam-mlx](https://github.com/aystream/gigaam-mlx).
- **Architecture:** 25-layer Zapformer encoder (`1024 / 1280 @2x / 1024`, `SwishL`/`SwishR`) with FiLM conditioning (`layers 3, 7, 11, 15, 19, 23`), FP32 residual late fusion (`1152 -> 2048 -> 1024`), and 4027-class SentencePiece RNN-T (`max_symbols_per_step=3`).
- **Parameters:** `771,353,916` active MLX parameters (`612` encoder/FiLM tensors in `float16`, `15` head & language-conditioning tensors in `float32`; `~1.5 GB` safetensors).
- **Capabilities:** Full-context & batched variable-length inference, real-time causal streaming (`160 / 320 / 640 ms`), word-level timestamps, optional pure-MLX Conformer VAD, and **zero PyTorch runtime dependency**.
## Supported Languages (`21` + `auto`)
`auto` (default), `ru`, `en`, `kk` (alias `kz`), `ky`, `uz`, `be`, `fr`, `es`, `ba`, `ka`, `hy`, `ro`, `tk`, `az`, `tg`, `de`, `it`, `nl`, `pl`, `pt`, `tt`.
Supports equal-weight mixtures (`"ru-en"`, `'["ru", "en"]'`), weighted mixtures (`'{"ru": 0.7, "en": 0.3}'`), and per-batch language lists (`["ru", "en"]`).
## Quick Start
```bash
pip install git+https://github.com/aystream/gigaam-mlx.git
```
### Python
```python
from gigaam_mlx import load_model, transcribe
model, tokenizer = load_model("multilingual", language="ru") # or "auto"
text = transcribe(model, tokenizer, "meeting.wav", vad=True)
print(text)
# Streaming with dynamic language switching (resets stream state)
stream = model.create_stream(tokenizer, future_context_ms=320, language="ru")
stream.set_language("en")
```
### CLI
```bash
gigaam-mlx recording.mkv --model-type multilingual --language ru --vad --word-timestamps --format all
gigaam-mlx recording.mkv --model-type multilingual --language '{"ru":0.7,"en":0.3}' --dtype float16
```
## Benchmarks (Apple Silicon M2 Max)
Measured on a 19.0s speech clip and 22-minute (`1319.4s`) audio (`batch_size=4`):
- **19.0s clip:** **0.131s (~146x realtime)** in FP16 / **0.147s (~129x)** in FP32 vs PyTorch CPU `2.007s` (~9.5x).
- **320 ms streaming (320 ms packets):** **30.9 ms/packet (~10.3x)** in FP16 / **34.3 ms/packet (~9.2x)** in FP32 (at 200 ms packets: `19.2 ms` FP16 / `21.9 ms` FP32).
- **Full 22-minute audio with VAD (`1319.4s`, warmed):** **8.43s (~157x realtime, 2.34 GB peak)** in FP16 / **9.93s (~133x, 4.65 GB peak)** in FP32.
- **PyTorch parity:** `mean abs encoder diff <= 6.8e-6` (`max <= 2.8e-4`) and identical decoded text, word timestamps, and `160 / 320 / 640 ms` streaming packet deltas across `auto`, `ru`, `en`, and `ru-en` vs PyTorch CPU FP32.
## Acknowledgments
- Original model & weights: [`ai-sage/GigaAM-Multilingual-v2`](https://huggingface.co/ai-sage/GigaAM-Multilingual-v2) and [Salute Developers GigaAM](https://github.com/salute-developers/GigaAM) (MIT License)
- MLX port: [aystream/gigaam-mlx](https://github.com/aystream/gigaam-mlx)