Run this model with HF Jobs

Run moonbox-dev/GigaAM-v4-TensorRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/moonbox-dev/GigaAM-v4-TensorRT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/moonbox-dev/GigaAM-v4-TensorRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

GigaAM-v4 TensorRT

TensorRT engines of GigaAM-v4, made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the engine, trt_runner.py (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest of the pipeline. What the engine takes and returns is under How to run.

Compatibility. The engines are built hardware compatible (Ampere and newer: RTX 30, 40 and 50 series) and version compatible (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an engine built for one GPU, but no rebuild is needed. Install the runtime with pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy.

Files

The last column is the benchmark (details under How to run).

Precision File Size sha256 Benchmark
fp16 fp16/LICENSE 1.1 kB d02ed0afc408 fp32 math without TF32 (as the ONNX fp16-storage build): WER 2.19 % English, 3.84 % Russian (the ONNX build 2.19 / 3.84 %), all 700 transcripts identical; RTF 0.0047 (ONNX 0.012)
fp16 fp16/advance.engine 59.7 MB e4275a4de4a4 (the same build: numbers in its first row)
fp16 fp16/config.json 0.1 kB c963d0329f2f (the same build: numbers in its first row)
fp16 fp16/e2e_tokenizer.model 14.7 kB f547bcb38e07 (the same build: numbers in its first row)
fp16 fp16/encoder.engine 1.04 GB 1e1253fbb937 (the same build: numbers in its first row)
fp16 fp16/mel_filters.npy 41.3 kB f4a5a69fa2be (the same build: numbers in its first row)
fp16 fp16/pipeline.py 4.2 kB bcd78f12d128 (the same build: numbers in its first row)
fp16 fp16/pipeline_trt.py 2.1 kB 1e6100d354a3 (the same build: numbers in its first row)
fp16 fp16/raw_tokenizer.model 15.4 kB dcbe2598d1b3 (the same build: numbers in its first row)
fp16 fp16/trt_runner.py 4.4 kB cbc9abb1f59c (the same build: numbers in its first row)

How to run

Sber's GigaAM-v4 as two TensorRT engines plus pipeline_trt.py. GigaAM-v4 is a 238M Zapformer RNN-T speech recogniser for Russian and English, with two output heads: "e2e" gives formatted text with punctuation and capitals, "raw" gives plain lower-case text. Its input is 16 kHz mono audio.

The pipeline is this model's ONNX pipeline.py (log-mel features and the SentencePiece decode in numpy), with both graphs run as engines.

import sys
import soundfile as sf
sys.path.insert(0, "fp16")
from pipeline_trt import GigaAMTrt
asr = GigaAMTrt("fp16")
x, sr = sf.read("speech.wav", dtype="float32")      # mono; other rates are resampled with soxr
print(asr(x, sr))                                   # head="raw" for plain lower-case text

Or python fp16/pipeline_trt.py speech.wav. It needs numpy, sentencepiece, TensorRT 10.13 (tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy (soundfile to read audio, soxr for rates other than 16 kHz). The engines are version-compatible and built for Ampere or newer GPUs (RTX 30-series and up).

The engines.

  • encoder.engine: audio_signal [1, 64, T] (log-mel, 10 ms hop; T from 100 to 3,000 frames, so 1-30 s) and length [1] -> encoded_len [1] and head_outputs [2, 1, T / 4, 320] (each head's encoder projection, e2e first). Split longer recordings first.
  • advance.engine: the greedy RNN-T decode of both heads, as the model's exporter scripts it (a loop inside the graph, at most 10 symbols per frame): projected [2, 1, T', 320], lengths [1] -> tokens [steps, 2, 1] (-1 where a row has ended).

Precisions. fp16/ is built from the ONNX fp16/ build, whose encoder weights are stored in fp16 and read as fp32. The casts are folded into fp32 weights, so the engines' math is fp32 like the ONNX build's, also without TF32. There is no int8: TensorRT's int8 needs calibrated activations. For a smaller file, use the ONNX int4/ build.

Benchmark.

  • Data: the lab's ONNX ASR set: 400 LibriSpeech test-clean clips (English) and 300 FLEURS ru_ru test clips (Russian). Greedy decoding, e2e head, on an RTX 3080 Laptop GPU.
  • Score: the word error rate against the ground truth, and against the ONNX fp16/ build's transcripts.
  • Pass mark (set before the first run): WER at most 1 point above the ONNX build's in each language. That build matches the original (the model's own transcribe, fp32 on CUDA) exactly.
WER English WER Russian transcripts identical to the ONNX build's real-time factor
ONNX fp16/ (CUDA) 2.19 % 3.84 % - 0.012
TensorRT fp16/ 2.19 % 3.84 % 700 of 700 0.0047

The real-time factor is for the whole pipeline, features and decode included.

How these were made

From GigaAM-v4 at revision 180301a192: each engine was built with TensorRT's builder from Moonbox's published ONNX graph of the same model and precision. The network is strongly typed: every tensor keeps the precision the ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU, it was benchmarked against the original before upload, and the sha256 column above is what the files must hash to.

License

MIT. These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged.


Original model card

GigaAM-v4

GigaAM-v4 is a Zapformer-based speech foundation model pretrained on 7 million hours of unlabelled audio and trained on 58,000 hours of supervised speech. Model supports full-context and streaming (160ms, 320ms, 640ms), providing both raw and e2e transcripts with dual-head ASR and shared encoder.

Versions

  • ssl: base foundation model.
  • rnnt: RNN-T dual-head ASR. The main branch points to this revision.
  • ctc: CTC dual-head ASR.

The RNNT revision includes paired SentencePiece tokenizers.

Russian WER (%)

Lower is better. All models use full-context E2E outputs.

Test set or group GigaAM-v4 RNN-T GigaAM-v4 CTC GigaAM-v3 RNN-T GigaAM-v3 CTC Whisper large-v3 (auto) Nemotron 30B-A4B (auto) Parakeet Ultra Qwen3-ASR 1.7B (auto)
Params 238M 234M 222M 220M 1.5B 34B (4.3B active) 627M 2B
Open-source data
Golos Crowd 4.56 5.05 7.43 8.12 12.22 4.36 2.86 13.14
Golos Farfield 3.62 4.07 4.97 5.71 16.11 8.25 6.47 20.22
Russian LibriSpeech 3.69 4.06 5.77 5.93 8.61 9.16 9.19 15.16
Mozilla Common Voice 27 2.29 2.68 2.24 2.51 5.88 4.81 5.41 7.55
In-house data
Disordered Speech 12.88 12.78 18.68 16.55 33.69 35.45 32.13 44.29
Callcenter 6.71 7.20 11.04 11.92 25.96 26.70 20.77 23.95
Natural Speech 8.32 8.43 10.37 11.48 16.22 14.26 13.99 17.53
Synth IT Terms 5.07 5.61 15.27 15.23 9.63 14.63 12.57 15.31
Education 6.80 7.04 9.83 10.04 15.72 12.71 12.19 15.65
Average 5.99 6.33 9.51 9.72 16.01 14.48 12.84 19.20

English: Results on the public subset of the Open ASR benchmark

All full-context and streaming models are E2E. Nemotron is English-forced

Set GigaAM-v4 RNN-T GigaAM-v4 CTC Whisper large-v3 Qwen3-ASR Canary Flash 1B Parakeet TDT-CTC GigaAM-v4 RNN-T (640 ms) Nemotron 3.5 ASR (1120 ms)
Params 238M 234M 1.55B 938M 883M 1.1B 238M 600M
Average 7.28 7.83 7.70 6.67 7.96 7.85 8.49 9.51
AMI-Cleaned 7.47 11.34 13.66 9.47 11.76 12.19 8.47 12.19
Earnings22-Cleaned-AA-chunked 7.91 7.71 7.81 8.07 6.99 8.36 8.66 13.54
Gigaspeech-Cleaned 8.38 9.78 8.37 7.62 8.65 8.43 8.98 9.36
SPGISpeech 2.00 2.15 2.69 2.74 1.69 1.99 2.36 3.03
URGENT24 15.57 14.84 13.65 11.59 17.66 14.96 19.11 18.23
Voice Arena Monsoon 4.88 4.44 3.95 4.13 4.58 5.10 7.06 6.33
Voxpopuli-AA-Cleaned 4.79 4.55 3.79 3.06 4.42 3.95 4.81 3.94

Usage

Load an ASR revision with Transformers and call transcribe. The result contains unformatted raw text and formatted e2e text.

from transformers import AutoModel

model = AutoModel.from_pretrained(
    "ai-sage/GigaAM-v4", revision="rnnt", trust_remote_code=True,
    device="cuda", fp16_encoder=True,
).eval()
result = model.transcribe("example.wav")
print(result["raw"].text)
print(result["e2e"].text)

Use revision="ctc" for CTC ASR or revision="ssl" for the SSL model.

Streaming

Send audio chunks to the stateful stream to receive formatted text as it arrives. Calling flush() returns any remaining text.

stream = model.create_stream(future_context_ms=160)
audio_pieces = model.model.prepare_wav("example.wav")[0][0].split(32000)
for packet in audio_pieces:
    print(stream.transcribe_partial(packet)["e2e"].text, end="")
print(stream.flush()["e2e"].text, end="")

ONNX

Export the model as a full-context or streaming graph.

model.to_onnx("onnx_fc")
sessions, cfg = model.load_onnx("onnx_fc", model.model.cfg.model_name)
print(model.infer_onnx("example.wav", cfg, sessions)["e2e"][0])

prefix = model.to_onnx("onnx_stream", streaming=True)
sessions, cfg = model.load_onnx("onnx_stream", prefix)
stream = model.create_onnx_stream(cfg, sessions, future_context_ms=160)
for packet in audio_pieces:
    print(stream.transcribe_partial(packet)["e2e"].text, end="")
print(stream.flush()["e2e"].text, end="")

Dependencies

pip install numpy "transformers<5" onnx onnxruntime hydra-core omegaconf sentencepiece tqdm

For fine-tuning and more advanced usage, see the GigaAM GitHub repository.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for moonbox-dev/GigaAM-v4-TensorRT

Quantized
(27)
this model