whisper-ro-onnx
Română
Conversie ONNX a modelului readerbench/whisper-ro (Whisper small reantrenat pe limba română de echipa ReaderBench), în structura de fișiere încărcată de Transformers.js (v4) pentru sarcina automatic-speech-recognition. Conversia este folosită de aplicația SIA Teren pentru transcrierea notelor vocale direct pe dispozitiv (în browser, WASM sau WebGPU).
Toate meritele pentru model aparțin autorilor originali (ReaderBench). Modelul original este distribuit sub licența Apache-2.0; această conversie păstrează aceeași licență. Ponderile nu au fost modificate în afară de exportul ONNX și cuantizare.
English
ONNX conversion of readerbench/whisper-ro (Whisper small fine-tuned on Romanian by ReaderBench) laid out for Transformers.js v4 (automatic-speech-recognition), mirroring onnx-community/whisper-small. Used by the SIA Teren app for on-device voice-note transcription. All credit for the model goes to ReaderBench; the original model is licensed under Apache-2.0 and so is this conversion.
Files / Fișiere
| File | dtype |
|---|---|
onnx/encoder_model.onnx |
fp32 |
onnx/encoder_model_quantized.onnx |
q8 |
onnx/encoder_model_q4.onnx |
q4 |
onnx/decoder_model_merged.onnx |
fp32 |
onnx/decoder_model_merged_quantized.onnx |
q8 |
onnx/decoder_model_merged_q4.onnx |
q4 |
Usage / Utilizare
import { pipeline } from '@huggingface/transformers';
const asr = await pipeline('automatic-speech-recognition', 'Gntz/whisper-ro-onnx', {
device: 'wasm', // or 'webgpu'
dtype: { encoder_model: 'q8', decoder_model_merged: 'q8' }, // WebGPU: { encoder_model: 'fp32', decoder_model_merged: 'q4' }
});
const { text } = await asr(audio16kHzFloat32, { language: 'romanian', task: 'transcribe', chunk_length_s: 30 });
Evaluation / Evaluare
Measured in Transformers.js 4.3.2 running in headless Chromium 153 (Playwright), device: 'wasm' (1 thread), dtype: { encoder_model: 'q8', decoder_model_merged: 'q8' }, language: 'romanian', task: 'transcribe', greedy decoding, chunk_length_s: 30, on the first 40 distinct sentences (by transcription, in dataset order) of the FLEURS Romanian test split (google/fleurs, ro_ro, CC-BY-4.0; 968 reference words, 434.6 s of audio). Normalization: lowercase, punctuation removed, ş/ţ → ș/ț, whitespace collapsed.
Măsurat în Transformers.js 4.3.2 în Chromium (WASM, q8/q8, română, greedy) pe primele 40 de propoziții distincte din FLEURS ro_ro test.
| Model (q8/q8, WASM) | WER | q8/q8 download |
|---|---|---|
| Gntz/whisper-ro-onnx (this repo) | 21.5 % | 249.6 MB |
| onnx-community/whisper-small | 34.7 % | 251.8 MB |
| onnx-community/whisper-base | 64.4 % | 79.7 MB |
Reference (PyTorch fp32 readerbench/whisper-ro, transformers 4.57.6, greedy, same 40 sentences): 19.8 % WER — the q8 ONNX conversion costs about 1.7 WER points.
Note: the fine-tuned model tends to write numbers as words (e.g. "o mie nouă sute șaizeci" for "1960"), which is counted as errors against the FLEURS references. / Notă: modelul scrie adesea numerele în litere, ceea ce se contorizează ca erori față de referințele FLEURS.
Conversion / Conversie
- Export:
optimum-cli export onnx --model readerbench/whisper-ro --task automatic-speech-recognition-with-past(opset 18, merged decoder withuse_cache_branch, tied embedding de-duplicated) - Quantization (same recipe as Transformers.js
scripts/quantize.py): q8 = onnxruntime dynamic quantization (encoder weights QUInt8, decoder weights QInt8, per_channel=false, reduce_range=false, EnableSubgraph); q4 = onnxruntimeMatMulNBitsQuantizer(block_size=32, symmetric). Seequantize_config.json. - Tool versions: optimum 2.1.0, optimum-onnx 0.1.0, transformers 4.57.6, torch 2.15.0+cpu, onnx 1.23.2, onnxruntime 1.31.1
- Source revision: readerbench/whisper-ro @
a2fd10c2cccb72bbec7f77781d4d34dab4c2241e