← All models

automatic-speech-recognition · audio · ONNX Runtime Web (WASM) · ~360 MB

wav2vec2 — Hungarian speech, one letter per frame

The English wav2vec2 demo speaks one language, the Russian XLSR demo another, and the Polish and Finnish VoxPopuli demos two more. This one recognises Hungarian. It is wav2vec2-base pre-trained self-supervised on 10,000 hours of unlabelled European-Parliament audio (VoxPopuli) and then fine-tuned on Hungarian — a compact ~95M-param CTC recogniser whose output alphabet carries the Hungarian diacritics (á é í ó ö ő ú ü ű). Same CTC mechanics as the other ASR demos: label every ~20 ms frame, then collapse the frames into text. Pick a clip and watch the frames collapse into Hungarian.

At a glance

ModelOpenVoiceOS/wav2vec2-base-10k-voxpopuli-ft-hu-onnx (ONNX export of facebook/wav2vec2-base-10k-voxpopuli-ft-hu)
Task / pipelineautomatic-speech-recognition — a wav2vec2 CTC model; we run the raw ONNX graph so we can see the frames
Architecturewav2vec2-base: a ~95M-param wav2vec2 encoder (12 transformer layers) pre-trained on 10k h of unlabelled VoxPopuli audio, fine-tuned for Hungarian. CTC head over a 39-symbol Latin-Hungarian vocab (blank + "▁" boundary + 26 letters + á é í ó ö ő ú ü ű). No decoder.
LanguageHungarian (hu) — this is a language-specialised recogniser; other languages produce Hungarian-phonetic gibberish
Not XLSR-53the canonical large wav2vec2-XLSR-53 Hungarian checkpoints are PyTorch/Flax only — no browser ONNX export, so they can't run in a browser today. This demo honestly uses the smaller wav2vec2-base VoxPopuli Hungarian model that does ship a real, runnable CTC ONNX, rather than relabel a different language's model.
RuntimeONNX Runtime Web (WASM) — not transformers.js. The OpenVoiceOS export is an onnx-asr graph: its config.json declares model_type: "wav2vec2-ctc" (which transformers.js doesn't register), the graph takes input_values + input_lengths and emits logprobs, and feature normalisation is baked in. So we drive the raw graph directly on ORT Web — the same engine transformers.js uses underneath.
Quantizationfp32 (model.onnx + model.onnx.data, ~360 MB) — the export ships no int8/q4 variant (onnxruntime's quantizer can't process this dynamo-exported graph, per the model card), so we honestly run and disclose the full-precision weights
Layoutonnx-asr export: a small model.onnx graph + external model.onnx.data weights + vocab.txt (token-id format, word delimiter ▁, blank <blk>). We fetch both, register the external data with ORT Web, and CTC-decode the log-probs ourselves.
BackendWebAssembly (single-thread — GitHub Pages can't set COOP/COEP for threads). No GPU required.
Download~360 MB (fp32 encoder), cached in Cache Storage after first load — heavy, so it's a one-off on Wi-Fi
LicenseCC BY-NC 4.0 (non-commercial) — inherited from the Meta-AI base model facebook/wav2vec2-base-10k-voxpopuli-ft-hu
Web APIsWebAssembly, Web Workers, Web Audio (decode + resample), Cache Storage, MediaRecorder (mic)

Run it

Choose Hungarian audio — record from your mic, upload a file, or pick the bundled sample. The page decodes it to 16 kHz mono, draws the waveform, and runs the CTC model in a Web Worker. It does best on clear Hungarian speech. First load is a ~360 MB fp32 download (no smaller export exists yet), then it's cached for offline reuse.

or a sample:
Hungarian — VoxPopuli (EU Parliament, CC0, 13s)

Transcript (Hungarian)

Transcribe a clip to see the Hungarian text here.

See inside — the CTC collapse over Hungarian letters

Below is the model's raw per-frame argmax: one cell per ~20 ms frame, showing the single character it thinks is most likely there. Most frames are blank (·) — the model saying "nothing new here". Where a sound lands you get a run of the same letter. The transcript is produced by two mechanical rules, no decoder involved: (1) merge consecutive duplicates, (2) drop the blanks. A run like ·· dd ·· oo o ·· mm ·· · collapses to dom.

emitted character ␣ word boundary · blank frame
Transcribe a clip to see its per-frame argmax and the collapse.

Why it matters

Self-supervised pre-training on huge piles of unlabelled speech — here 10,000 hours of European-Parliament audio — is how you get a good recogniser for a language like Hungarian from a modest amount of labelled data. The model learned what human speech sounds like before it ever saw a Hungarian transcript. That is what puts a usable Hungarian recogniser inside a browser tab — private, offline once cached, no server, no key. And because it's CTC (frames, not generated tokens) it can't hallucinate an unspoken sentence, and every character is pinned to a moment in time.

Use cases

Basics

One Hungarian clip in, Hungarian text out — and the per-frame strip that produced it.

Practical

Forced alignment: real per-word Hungarian timings, straight from the CTC frames.

Wild

Feed it English and watch a Hungarian-only model transliterate the sounds.

Multi-model

Transcribe Hungarian → OPUS-MT translates it to English, all on-device.

How the API works

The Hungarian ONNX export is packaged for the onnx-asr toolkit, not transformers.js — its config.json declares model_type: "wav2vec2-ctc", so transformers.js's AutoModelForCTC refuses it (Unsupported model type). Instead we drive the raw graph directly on ONNX Runtime Web — feature normalisation is baked in, so we feed the raw 16 kHz waveform and CTC-decode the log-probs ourselves:

import * as ort from "onnxruntime-web";

const base = "https://huggingface.co/OpenVoiceOS/wav2vec2-base-10k-voxpopuli-ft-hu-onnx/resolve/main/";
const graph = new Uint8Array(await (await fetch(base + "model.onnx")).arrayBuffer());
const data  = new Uint8Array(await (await fetch(base + "model.onnx.data")).arrayBuffer()); // ~360 MB fp32

const session = await ort.InferenceSession.create(graph, {
  executionProviders: ["wasm"],
  externalData: [{ path: "model.onnx.data", data }],   // register the external weights
});

// audio = raw 16 kHz mono Float32Array (normalisation is inside the graph)
const { logprobs } = await session.run({
  input_values:  new ort.Tensor("float32", audio, [1, audio.length]),
  input_lengths: new ort.Tensor("int64", BigInt64Array.from([BigInt(audio.length)]), [1]),
});
// logprobs shape [1, frames, 39]  ← 39 Latin-Hungarian symbols, log-softmax

// greedy CTC decode: argmax per frame, merge duplicates, drop the blank (id 0), '▁' → space
const ids  = argmaxPerFrame(logprobs);
const text = collapse(ids);            // Hungarian text — no decoder involved

Inference runs in a Web Worker so the UI never janks. The worker returns the raw per-frame argmax and real per-word timings (from the frame each character was emitted at) — nothing is faked or pre-computed.

References