Views
No views yet
whisper.cpp
and ONNX formats, and invites conversions to other formats. No MLX build of the
medium model existed. This repository provides one.On the model tree: Hugging Face'sbase_model_relationfield only acceptsfinetune,adapter,mergeorquantized. None of these describes a pure format conversion, so the field is deliberately omitted here and the Hub may infer a label that overstates the relationship. This model is a format conversion of the base weights — nothing more.
whisper.cpp is another route, and the National Library ships a GGML
build for it.)medium is the size that fits comfortably alongside other work on a 16–24 GB
Mac: roughly half the weights of large, 2.2 GB peak memory, and in the
measurement below it ran 1.8× faster than large at the same word error
rate on read Bokmål. That result is specific to this benchmark — see the
caveat under the table.1brew install ffmpeg
2pip install mlx-whisper==0.4.3ffmpeg must be on your PATH — mlx_whisper shells out to it to decode
audio. With Homebrew on Apple Silicon that usually means:export PATH="/opt/homebrew/bin:$PATH"1import mlx_whisper
2
3result = mlx_whisper.transcribe(
4 "audio.wav",
5 path_or_hf_repo="viavicdev/nb-whisper-medium-mlx-fp16",
6 language="no",
7)
8print(result["text"])mlx-whisper selects its bundled
multilingual tokenizer from n_vocab (51,865 → the 99-language,
Whisper-v2-era multilingual vocabulary this model uses), so this repository
ships only config.json and the weights.weights.safetensors. mlx_whisper's
loader looks for weights.safetensors, then falls back to weights.npz. A
file named model.safetensors — which is what the standard conversion script
writes — produces the misleading error
ValueError: [load_npz] Input must be a zip file or a file-like object that can be opened with zipfile.ZipFile. This repository uses the correct name;
the note is here in case you re-convert.mlx_whisper reads that from config.json and handles it automatically, but
it matters if you build your own feature extraction.alignment_heads [192, 2]. Hugging Face checkpoints do not carry
Whisper's model-specific alignment heads, so mlx_whisper falls back to its
default — every head in the second half of the decoder (12 layers × 16 heads).
Segment-level timestamps are unaffected; word_timestamps=True will be less
precise than with calibrated heads.google/fleurs
nb_no, validation split, CC-BY-4.0. Every sentence in the split appears two or
three times with different readers; the set used here is one utterance per
unique sentence id (the first row per id in dev.tsv), which gives 111
utterances / 1,415.0 seconds of read Bokmål. Deduplicating matters: without it
some sentences are weighted two or three times.mlx 0.32.0 · mlx-whisper 0.4.3 · ffmpeg 8.1.2transcription column, with
the same normalisation applied to reference and hypothesis — lowercased,
punctuation stripped, whitespace collapsed. Numbers are not normalised, so
15 versus femten counts as an error.| nb-whisper-medium-mlx-fp16 | nb-whisper-large, MLX fp16 | |
|---|---|---|
| WER | 7.00 % | 7.00 % |
| Errors / reference words | 165 / 2,358 | 165 / 2,358 |
| Utterances with zero errors | 42 / 111 | 44 / 111 |
| Total inference time | 72.8 s | 131.2 s |
| Speed | 19.5× real time | 10.8× real time |
| Cold model load | 4.7 s | 9.6 s |
| Peak memory | 2.2 GB | not recorded |
The identical WER is a coincidence of aggregation, not evidence that the two models behave the same. They produced different transcriptions for 45 of the 111 utterances and different error counts for 41 of them. Medium was better on 21 utterances, large on 20, and they tied on 70. Each truncated exactly one utterance. The totals happened to land on the same number.What the measurement does support: on read Bokmål,mediumcosts nothing measurable in accuracy while running 1.8× faster in half the memory. On harder material — spontaneous speech, noise, overlapping speakers, dialect —largemay well pull ahead. That was not tested here.
3 → tre, 2 → to, nr → nummer, 100 m → 100 meter, på grunn av → pga.vitenskapelig forskning → vitenskapelige forskningen,
statlige → statlig.Aucklands → Auklands, Komorene → Comorene,
Krezel → Kresel.ufint → en ufin, rumenere → rumerne),
mostly on foreign names and dense subordinate clauses.den nye befolkningen vil trenge ulike funksjoner eller tilpasninger enn det de trengte før for å være en sterk konkurrent siden dette nye miljøet har ulike ressurser og ulike konkurrenter
! and nothing else — no fabricated
sentence. This is one test, not a guarantee; see the limitation below.large did the same on
a different utterance. If completeness matters, check output length against
audio duration rather than assuming a returned transcript is a finished one.viavicdev/nb-whisper-large-mlx-fp16
— the large model, same conversion procedure, same float16 policy, measured
on the same set.google/fleurs (Conneau et al.),
licensed CC-BY-4.0.