Run this model with HF Jobs

Run moonbox-dev/GigaAM-Multilingual-v2-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-Multilingual-v2-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-Multilingual-v2-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 Multilingual v2 TensorRT

TensorRT engines of GigaAM Multilingual v2, 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; the encoder engine 3.2 GB): WER 1.91 % (the ONNX build 1.91 %), all 400 transcripts identical; RTF 0.0081 (ONNX 0.020)
fp16 fp16/advance.engine 70.4 MB e60454001401 (the same build: numbers in its first row)
fp16 fp16/config.json 0.3 kB 43e39934c897 (the same build: numbers in its first row)
fp16 fp16/e2e_tokenizer.model 54.2 kB 3b049685e51a (the same build: numbers in its first row)
fp16 fp16/encoder.engine 3.23 GB 9c8882385716 (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.8 kB 4689dec3dde7 (the same build: numbers in its first row)
fp16 fp16/pipeline_trt.py 2.2 kB d3b6f7896f5a (the same build: numbers in its first row)
fp16 fp16/raw_tokenizer.model 26.9 kB c51fe228b747 (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 Multilingual v2 as two TensorRT engines plus pipeline_trt.py. It is a 776M Zapformer RNN-T speech recogniser for 21 languages: Russian, English, Kazakh, Kyrgyz, Uzbek, Belarusian, French, Spanish, Bashkir, Georgian, Armenian, Romanian, Turkmen, Azerbaijani, Tajik, German, Italian, Dutch, Polish, Portuguese and Tatar. It has 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 with both graphs run as engines. The log-mel features, the language vector and the SentencePiece decode stay in numpy.

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, "en"))                             # language code, or None for "auto"; head="raw" for plain text

Or python fp16/pipeline_trt.py speech.wav en. It needs numpy, sentencepiece, TensorRT 10.13 (tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy. Reading audio needs soundfile, and rates other than 16 kHz need soxr. 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), length [1] and language_vector [1, 32] (one-hot: slot 0 "auto", then the languages in config.json order) -> 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 3 symbols per frame. projected [2, 1, T', 320] and 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. This makes the encoder engine 3.2 GB, twice the ONNX file. 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, language "en", 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. That build matches the original (the model's own transcribe, fp32 on CUDA: 1.91 %) exactly.
WER transcripts identical to the ONNX build's real-time factor
ONNX fp16/ (CUDA) 1.91 % - 0.020
TensorRT fp16/ 1.91 % 400 of 400 0.0081

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

How these were made

From GigaAM Multilingual v2 at revision c9d7aee4af: 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 Multilingual v2

GigaAM Multilingual-v2 brings speech recognition to 21 languages. The model was pretrained on 10 million hours of unlabelled audio and trained on 155,000 hours of supervised speech. Model uses two RNN-T heads for raw (unformatted) and e2e (formatted) transcripts. Both full-context and streaming (160ms, 320ms, 640ms) ASR are supported.

Versions

  • ssl: base foundation model.
  • rnnt: RNN-T dual-head ASR with optional language conditioning. The main branch points to this revision.

The RNNT revision includes paired SentencePiece tokenizers.

Multilingual WER (%)

Lower is better. GigaAM uses auto language mode in full-context and 640 ms streaming inference.

Language GigaAM (776M) GigaAM (776M, 640 ms) Omni LLM (7B) Whisper large-v3 (1.55B) Qwen3-ASR (1.7B) Rumble-2-Flash (0.5B) Parakeet Ultra (0.6B)
Average 3.96 5.58 14.10 44.09 59.80 52.77 55.64
Russian 2.30 3.38 6.75 4.81 6.05 8.12 4.83
English 5.42 7.48 7.86 11.04 4.55 6.23 5.62
German 3.16 4.54 4.92 4.42 4.16 5.49 3.93
Spanish 3.06 3.80 3.73 3.55 3.49 3.91 3.21
French 5.36 7.11 7.13 7.80 6.04 7.97 5.70
Italian 2.28 3.13 3.38 3.68 3.54 3.80 2.65
Dutch 2.72 4.23 4.63 4.54 5.64 5.00 4.69
Polish 3.40 5.25 6.04 5.51 12.92 6.56 3.69
Portuguese 4.32 5.75 6.09 5.24 5.49 5.43 5.75
Romanian 4.90 7.28 17.20 16.73 45.62 12.25 14.76
Azerbaijani 5.31 8.14 24.85 26.58 80.15 17.64 100.51
Bashkir 2.74 4.58 12.83 96.49 107.49 108.88 101.80
Belarusian 2.50 3.71 7.25 74.02 85.09 15.58 81.70
Armenian 3.06 3.96 7.97 47.86 114.44 122.29 105.97
Georgian 4.52 6.04 10.34 68.64 127.93 136.58 113.51
Kyrgyz 4.32 5.71 17.51 87.32 107.44 107.04 103.25
Kazakh 3.95 5.75 14.20 35.82 105.95 107.72 101.27
Tajik 4.98 6.05 29.82 111.82 106.55 106.69 102.65
Turkmen 6.85 10.18 30.97 108.65 108.65 106.96 101.98
Tatar 4.31 6.08 50.72 96.66 106.94 107.15 103.49
Uzbek 3.70 5.08 21.82 104.79 107.61 106.88 97.57

Usage

Load the RNN-T revision with Transformers and call transcribe. Pass a supported language tag to select the language. The auto mode is also available.

from transformers import AutoModel

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

Use 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. The model uses the auto language setting from the loader unless you select another language.

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-Multilingual-v2-TensorRT

Quantized
(19)
this model