Quantized ONNX export of
nvidia/parakeet-tdt-0.6b-v3 for browser and edge inference with
parakeet.js.
409 MB total — 6x smaller than fp32, 39% smaller than
istupakov/int8, with half the quantization degradation and 17% faster inference.
1import { fromUrls } from 'parakeet.js';
2
3const BASE = 'https://huggingface.co/efederici/parakeet-tdt-0.6b-v3-onnx-int4/resolve/main';
4
5const model = await fromUrls({
6 encoderUrl: `${BASE}/encoder-model.int4.onnx`,
7 decoderUrl: `${BASE}/decoder_joint-model.int8.onnx`,
8 tokenizerUrl: `${BASE}/vocab.txt`,
9 preprocessorBackend: 'js',
10 backend: 'webgpu', // or 'wasm'
11});
12
13const result = await model.transcribe(pcm, 16000, {
14 returnTimestamps: true,
15 returnConfidences: true,
16});
17console.log(result.utterance_text);
1const result = await model.transcribeLongAudio(pcm, 16000, {
2 returnTimestamps: true,
3 chunkLengthS: 95,
4});
5console.log(result.text);
6console.log(result.chunks);
CPU inference with onnxruntime.
All three models achieve the same ground-truth WER (~1.7%). The quantized models actually score marginally better due to a slight regularization effect.
Half the degradation of int8, at 39% smaller size and 17% faster speed.
CC-BY-4.0, inherited from
nvidia/parakeet-tdt-0.6b-v3.