automatic-speech-recognition Β· audio Β· WASM (WebGPU when available) Β· ~1.2 GB
The French, Spanish and Russian demos are all the same cross-lingual cousin β XLSR-53, pre-trained on 53 languages (56,000 hours of multilingual audio) β fine-tuned per language. This one is fine-tuned on Korean, and it does something the Latin-script versions can't: its CTC head is not an alphabet of letters. It emits whole Hangul syllable blocks β κ°, κ°, κ° β¦ ν β from a 1205-symbol vocabulary. Every ~20 ms frame is labelled with one complete syllable, and the transcript is just those frames collapsed. Pick a clip and watch the syllables assemble into Korean.
| Model | FinDIT-Studio/wav2vec2-large-xlsr-53-korean-onnx (base: jonatasgrosman/wav2vec2-large-xlsr-53-korean) |
|---|---|
| Task / pipeline | automatic-speech-recognition β loaded as AutoModelForCTC so we can see the frames |
| Architecture | XLSR-53: wav2vec2-large cross-lingual encoder (24 transformer layers, ~315M params) pre-trained on 53 languages, fine-tuned for Korean. CTC head over a 1205-symbol Hangul-syllable vocab (blank + "|" boundary + 1202 syllable blocks + [UNK]). No decoder. |
| Language | Korean (ko) β a syllable-level recogniser over Hangul; other languages produce Korean-phonetic gibberish |
| Quantization | fp32 (full precision) ONNX β a single model.onnx at the repo root (no q8/q4 export exists for this model, so we load fp32 with subfolder:"") |
| Config & tokenizer | the repo ships a tokenizer.json but no config.json and no preprocessor_config.json. So we borrow the wav2vec2-large XLSR-53 architecture config from a reachable sibling (the Korean base repo is access-gated), override vocab_sizeβ1205, do the feature extraction ourselves, and CTC-decode from the model's own 1205-symbol vocab. No sibling weights are used β all weights are the Korean model.onnx. |
| Backend | WebAssembly (WebGPU when a real adapter is present), honest fallback |
| Download | ~1.2 GB (single fp32 encoder), cached after first load β a big one-time transfer |
| License | Apache-2.0 (base model) β the ONNX-export repo declares no license of its own |
| Web APIs | WebAssembly / WebGPU, Web Workers, Web Audio (decode + resample), MediaRecorder (mic) |
Choose Korean audio β record from your mic, upload a file, or pick a bundled CC0 sample. The page decodes it to 16 kHz mono, draws the waveform, and runs the CTC model in a Web Worker. XLSR-53 does best on clear Korean speech. Heads up: this model has no quantized export, so the first load is a ~1.2 GB fp32 download.
This context didn't grant mic access (common in headless / embedded views). The model still works β use a sample above or Upload audio. For live recording, open this in a normal browser tab and allow the microphone when prompted, then speak Korean.
This checkpoint is a compact, cross-lingual recogniser rather than a large Korean-only model, so expect the odd near-homophone slip (e.g. μ¬βμ ) β that is honest real ASR output, produced entirely on your device.
Below is the model's raw per-frame argmax: one cell per ~20 ms frame, showing the
single syllable 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 syllable. The
transcript is produced by two mechanical rules, no decoder involved:
(1) merge consecutive duplicates, (2) drop the blanks. A run like
Β·Β· κ° κ° Β·Β· μ μ Β·Β· collapses to κ°μ.
Raw per-frame argmax (β frames Β· ~β ms each):
β merge duplicates, drop blanks β
Most of the world's ~7,000 languages have little labelled speech data. Cross-lingual self-supervised pre-training is how the field reaches them: XLSR-53 learns speech structure from 53 languages at once, so fine-tuning to a new language needs far fewer transcripts. That is what puts a usable Korean 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 syllable is pinned to a moment in time.
One Korean clip in, Korean text out β and the per-frame syllable strip that produced it.
Forced alignment: real per-syllable Korean timings, straight from the CTC frames.
Feed it English and watch cross-lingual transfer break down into Korean phonetics.
Transcribe Korean with XLSR β OPUS-MT translates it to English, all on-device.
Normally the one-liner is the ASR pipeline β but this repo ships no config.json and
keeps its ONNX at the repo root, so we load the model directly (borrowing an XLSR-53 sibling's
architecture config) and do the CTC collapse ourselves (which is exactly what the pipeline does
internally):
import { AutoConfig, AutoModelForCTC } from "@huggingface/transformers";
const model_id = "FinDIT-Studio/wav2vec2-large-xlsr-53-korean-onnx";
// Repo has no config.json β borrow a reachable XLSR-53 sibling's config (architecture only, no weights)
const config = await AutoConfig.from_pretrained("jonatasgrosman/wav2vec2-large-xlsr-53-spanish");
config.vocab_size = 1205; // β¦then match the Korean CTC head (1205 Hangul syllables)
config.pad_token_id = 1204; // [PAD] is the CTC blank
const model = await AutoModelForCTC.from_pretrained(model_id, {
device: "wasm", dtype: "fp32", // the only export is a single fp32 model.onnxβ¦
subfolder: "", config, // β¦at the repo ROOT, not the usual onnx/ subfolder
});
// audio = 16 kHz mono Float32Array, normalised to zero-mean/unit-variance
const { logits } = await model({ input_values }); // shape [1, frames, 1205]
// greedy CTC decode: argmax per frame, merge duplicates, drop the blank (id 1204)
const ids = argmaxPerFrame(logits); // e.g. [1204,1204,26,26,1204,1140,...]
const text = collapse(ids); // "κ°μβ¦" in Hangul β no decoder involved
Inference runs in a Web Worker so the UI never janks. The worker returns the raw per-frame argmax (whole syllables) and real per-word timings (from the frame each syllable was emitted at) β nothing is faked or pre-computed.