A Polish fine-tune of ai-sage/GigaAM-Multilingual-v2
(rnnt revision). The architecture, code and both RNN-T heads (raw and e2e) are unchanged. Full-context and streaming
(160 / 320 / 640 ms look-ahead) recognition work as in the base model.
The gain is on conversational speech. Telephone dialogues, conversations and interviews have 30–50% fewer errors than the base model. Medical dictation has about half the errors. Read speech (FLEURS) is unchanged.
GGUF files for audio.cpp (CPU, no Python, streaming) are in
shefowl/gigaam-multilingual-v2-pl-GGUF. Its Q8_0 is as
accurate as PyTorch and runs at 0.07× real time on 4 CPU threads. An int8 ONNX export of the streaming model is in
onnx_stream_int8/.
Word error rate (%, lower is better). Text is lowercased and punctuation removed before scoring. The e2e head is
used, language pl.
| Test set | Base, full context | This model, full context | Base, 640 ms streaming | This model, 640 ms streaming |
|---|---|---|---|---|
| Telephone dialogues (LUNA) ¹ | 28.6 | 16.6 | 35.1 | 19.9 |
| Conversations (PELCRA SpokesBiz) | 23.4 | 16.5 | 29.2 | 20.8 |
| Interviews (PELCRA SpokesMix) | 29.7 | 15.0 | 29.1 | 17.3 |
| Medical dictation, clinic rooms (ADMEDVOICE) ¹ ² | 32.3 | 15.1 | 37.1 | 18.2 |
| FLEURS pl (read) | 4.65 | 4.75 | 6.42 | 6.50 |
| FLEURS, simulated far field ³ | 11.4 | 11.5 | 16.95 | 16.95 |
¹ Other speakers from the same corpus were in the training data. The test speakers were not. ² ADMEDVOICE repeats the same sentences across speakers: most test sentences are also read by training speakers. To avoid counting memorised sentences, this row uses only the 63 test utterances whose text never occurs in training. Training also left out every utterance whose text occurs in any ADMEDVOICE test set. ³ Made by us: simulated room impulse responses plus noise. Training used the same kind of simulation as augmentation, with a separate set of rooms and noise files.
Notes:
onnx_stream_int8/), 640 ms streaming, first 200 utterances of each set (fp32 → int8):
FLEURS 6.5 → 7.0, LUNA 19.6 → 21.8, SpokesBiz 17.8 → 18.0, SpokesMix 11.2 → 10.8. The fp32 ONNX export gives
the same numbers as PyTorch, so the difference is the quantization. Telephone speech loses the most. For the best
accuracy, export fp32 yourself with model.to_onnx("onnx_stream", streaming=True).Same code as the base model (trust_remote_code, Transformers 4.x).
pip install numpy "transformers<5" onnx onnxruntime hydra-core omegaconf sentencepiece tqdm
from transformers import AutoModel
model = AutoModel.from_pretrained(
"shefowl/gigaam-multilingual-v2-pl", trust_remote_code=True, language="pl",
device="cuda", fp16_encoder=True,
).eval()
result = model.transcribe("example.wav", language="pl")
print(result["e2e"].text) # punctuated, cased
print(result["raw"].text) # lowercase, no punctuation
stream = model.create_stream(future_context_ms=640) # 160, 320 or 640
audio_pieces = model.model.prepare_wav("example.wav")[0][0].split(16000 * 640 // 1000)
for packet in audio_pieces:
print(stream.transcribe_partial(packet)["e2e"].text, end="")
print(stream.flush()["e2e"].text)
onnx_stream_int8/ is the streaming graph from model.to_onnx(..., streaming=True). The MatMul and Gemm weights of
the encoder and the streaming step are quantized to int8 with onnxruntime dynamic quantization. The other graphs
stay fp32. It is about 1.6 GB on disk.
from huggingface_hub import snapshot_download
d = snapshot_download("shefowl/gigaam-multilingual-v2-pl", allow_patterns=["onnx_stream_int8/*"])
sessions, cfg = model.load_onnx(f"{d}/onnx_stream_int8", "rnnt_dynamic")
stream = model.create_onnx_stream(cfg, sessions, future_context_ms=640)
for packet in audio_pieces:
print(stream.transcribe_partial(packet)["e2e"].text, end="")
print(stream.flush()["e2e"].text)
MIT, as the base model. The code (modeling_gigaam.py), tokenizers and VAD files are copied unchanged from
ai-sage/GigaAM-Multilingual-v2 (revision c21483b).
model.safetensors 1.4 GiBonnx_stream_int8/rnnt_dynamic_encoder.onnx 745 MiBonnx_stream_int8/rnnt_dynamic_stream_step.onnx 742 MiBonnx_stream_int8/rnnt_dynamic_advance.onnx 22 MiBonnx_stream_int8/rnnt_dynamic_stream_frontend.onnx 8 MiBonnx_stream_int8/rnnt_dynamic_e2e_decoder.onnx 8 MiBonnx_stream_int8/rnnt_dynamic_e2e_joint.onnx 7 MiBonnx_stream_int8/rnnt_dynamic_raw_decoder.onnx 6 MiBvad.safetensors 5 MiBonnx_stream_int8/rnnt_dynamic_raw_joint.onnx 4 MiB