This is an unofficial conversion of qnguyen3/QUAN-Transcribe-1.0
(Vietnamese CTC speech recognition built on the EmbeddingGemma 2 audio encoder) to ONNX, with an 8-bit quantized
variant and an ONNX Runtime (.ort) file for mobile. It is not affiliated with or endorsed by the original author or Google.
Gemma Terms of Use apply — see License.
| File | Size | Use |
|---|---|---|
quan_int8.onnx + quan_int8.onnx.data |
9.7 MB + 378 MB | int8 weights, ONNX. Keep both files in the same folder. Linux / desktop / mobile via ONNX Runtime |
quan_int8.ort (+ quan_int8.required_operators.config) |
368 MB | Same model in ONNX Runtime format (self-contained) for ONNX Runtime Mobile, optional reduced-size builds |
fp32/quan_fp32.onnx + .data |
10 MB + 1.4 GB | Full precision reference |
assets/ |
0.3 MB | vocab.json (unit → piece), mel window / filter bank / mel_config.json |
quan_onnx_infer.py |
Reference pipeline (numpy + onnxruntime) to port to Swift / Kotlin / C++ |
Real model size: the original repo's model.safetensors only holds about 100M parameters (the reader and the
fine-tuned top encoder layers); the frozen remainder of the encoder is downloaded from google/embeddinggemma-2.
The complete network is 356M parameters, which is what these files contain (1.4 GB in fp32, ~380 MB in int8).
pip install -r requirements.txt
python quan_onnx_infer.py audio.wav --model quan_int8.onnx
from quan_onnx_infer import Quan, load_audio
print(Quan("quan_int8.onnx", threads=4).transcribe(load_audio("audio.wav")))
feats: float32 [1, 1000, 128] — log-mel features of up to 10 s of 16 kHz mono audio, zero padded at the end.n_out: int64 [1] — number of valid encoder frames, ceil(n_valid_mel_frames / 4). Frames after it are ignored by the reader.logits: float32 [1, 250, 14919]. Use only the first n_out frames. Greedy CTC: argmax, collapse repeats, drop unit 0 (blank).i → assets/vocab.json["pieces"][i]; ▁ is a space. Unit 1 (<unk>) never needs to be emitted.mel_window_320.f32,
512-point FFT magnitude, multiply by the [257, 128] filter bank (mel_filters_257x128.f32), log(x + 0.001).
quan_onnx_infer.py is the reference; it matches the original feature extractor to 4e-6.split_windows).iOS / Android: use ONNX Runtime Mobile (onnxruntime-objc / onnxruntime-android) with quan_int8.ort.
The int8 model was only tested here with the ONNX Runtime CPU provider on Linux (aarch64); it has not been tested
on a phone, nor with NNAPI / CoreML execution providers.
Google FLEURS Vietnamese test split, first 100 utterances only; punctuation removed and text lower-cased; WER in %. "No-digit" is the 84 utterances whose reference has no digits, because the model spells numbers as words while FLEURS uses digits. All variants use 10 s windows except the first row.
| Variant | WER (100 utt.) | WER (84 no-digit utt.) |
|---|---|---|
| Original PyTorch, 30 s windows (reference) | 10.45 | 6.80 |
| Original PyTorch, 10 s windows | 10.71 | 6.84 |
| ONNX fp32 | 10.68 | 6.84 |
| ONNX int8 | 10.91 | 7.23 |
Compared with the original repo's own greedy results on the full FLEURS test (6.75 reported by the author), this sample is small: treat differences below about 1 point as noise. Int8 costs about 0.4 point WER here.
Speed on a Cortex-X925 CPU (aarch64 Linux, ONNX Runtime 1.31, one 10 s window): int8 0.37 s with 1 thread, 0.15 s with 4 threads; fp32 1.41 s / 0.42 s. These are not phone numbers.
Exported from the original checkpoint with PyTorch's ONNX exporter (opset 18) after rewriting the encoder forward without hooks and replacing the
attention mask builder with an equivalent closed form (verified identical); weights of MatMul nodes were quantized to int8 with
ONNX Runtime dynamic quantization; the .ort file was produced with onnxruntime.tools.convert_onnx_models_to_ort
(runtime optimization style, ONNX Runtime 1.31).
These files are Model Derivatives of Gemma and are provided under the
Gemma Terms of Use (copy in GEMMA_TERMS_OF_USE.txt). Use is subject to the
Gemma Prohibited Use Policy (copy in GEMMA_PROHIBITED_USE_POLICY.txt),
which must be passed on to anyone you share these files with. See NOTICE for the modifications made. This is not legal advice.
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo braitoli/QUAN-Transcribe-1.0-ONNX ./model-folderfp32/quan_fp32.onnx 10 MiBquan_int8.onnx 9 MiBqnguyen3/QUAN-Transcribe-1.0