Views
No views yet
openai/whisper-base.en
for Transformers.js, exported so that the
decoder emits cross-attention outputs, which is what word-level timestamps
(return_timestamps: 'word') are computed from in the browser.cross_attentions.* in
WhisperForConditionalGeneration._extract_token_timestamps, so with a stock
export it fails with:Model outputs must contain cross attentionscross_attentions.{0..5} (plus decoder_attentions.* and
encoder_attentions.*) and traces the model with output_attentions=True so
those outputs are actually written, not merely declared.1import { pipeline } from '@huggingface/transformers';
2
3const transcriber = await pipeline(
4 'automatic-speech-recognition',
5 'mgndxb/whisper-base.en-timestamped-onnx',
6 {
7 revision: '<pin an immutable commit sha>',
8 dtype: { encoder_model: 'fp32', decoder_model_merged: 'fp32' },
9 },
10);
11
12const out = await transcriber(audio, {
13 return_timestamps: 'word',
14 chunk_length_s: 30,
15 stride_length_s: 5,
16});generation_config.json carries the alignment_heads this checkpoint needs —
[[3, 3], [4, 7], [5, 1], [5, 5], [5, 7]] — taken unmodified from the upstream
repository. Word timestamps are unavailable without them.| File | Bytes | SHA-256 |
|---|---|---|
onnx/encoder_model.onnx | 82,427,162 | 7bba878a5cf2faaa17b5e2d0b1a53cc086fd425e5e89e18ea8402c4356f73293 |
onnx/decoder_model_merged.onnx | 314,560,221 | e2657d40db662b2c0a25a4e51b83bbe3cc4dede58e255245a9bc4b516f4a4435 |
config.json | 1,273 | f150ffdf49b5a438d036aa6fed357dfd5403507d0521f7639a05756d0e362ee3 |
generation_config.json | 1,526 | 7eb6f9dca9df06ca5ae8ed43ee5b05b200af22fedbb3fe7e0f10ea354e44b641 |
preprocessor_config.json | 356 | 994838f1fa6462c8b9b3c90edada831f11f3dd8b4664634e18f4694d005c9dbf |
tokenizer.json | 3,855,707 | 287537d5be89a39bd18e7e3875ad9900faa668493fb759392b8f52a492eca5db |
tokenizer_config.json | 282,692 | 7498445adabf4fd836db90b0f0d979ca9dc0b543528e5d9f1912430a5879e212 |
special_tokens_map.json | 2,173 | 98bdf3ec5b32e31575b02f64b0a32bde7c0449075d34484a7df9bdd3cdeb9fb9 |
added_tokens.json | 34,604 | 560be47bea388757f8d4cc185c5d82067426cbb6361e38016dd90ddc01ab203a |
vocab.json | 798,156 | 3ba3c3109ff33976c4bd966589c11ee14fcaa1f4c9e5e154c2ed7f99d80709e7 |
merges.txt | 456,318 | 1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5 |
normalizer.json | 52,666 | bf1c507dc8724ca9cf9903640dacfb69dae2f00edee4f21ceba106a7392f26dd |
MANIFEST.json in this repository records the same hashes alongside the exact
tool versions used, and is generated by the conversion script rather than
written by hand.openai/whisper-base.en
Upstream revision: 911407f4214e0e1d82085af863093ec0b66f9cd6
Upstream licence: Apache-2.0| Python | 3.12.13 |
torch | 2.13.0 |
transformers | 4.57.6 |
optimum | 2.1.0 |
optimum-onnx | 0.1.0 |
onnx | 1.22.0 |
onnxruntime | 1.28.0 |
optimum.exporters.onnx.main_export with task
automatic-speech-recognition-with-past, model_kwargs={"output_attentions": True},
and a WhisperOnnxConfig subclass that adds the attention graph outputs. The
three submodel configs use Optimum's own behaviour split — encoder;
decoder (use_past=True, use_past_in_inputs=False); decoder-with-past
(use_past=True, use_past_in_inputs=True) — after which Optimum merges the two
decoders into decoder_model_merged.onnx. Unmerged intermediates are discarded.scripts/extra/whisper.py from
Transformers.js v2.17.2 (Apache-2.0), re-implemented against a current Optimum.cross_attentions.* outputs are present in
decoder_model_merged.onnx, populated by an ONNX Runtime run with shape
(batch, 8 heads, decoder_len, 1500), and each row sums to 1 as a softmax
should — a declared-but-never-written output would pass a name check and fail
in production.alignment_heads entry indexes a layer and head that exist.@huggingface/transformers, on both the
WebGPU and the WASM backend, against 15–30s of real English speech: the
pipeline loads, return_timestamps: 'word' succeeds with no cross-attention
error, and word timestamps are monotonic and inside the clip.whisper-base.en is an English-only checkpoint. It does not
transcribe or translate other languages, and will emit confident nonsense if
given them.base is the small end of the family. Expect noticeably worse accuracy
than small/medium on accented speech, overlapping speakers, and noise.Missing required scale ... DequantizeLinear). Add them only behind their
own parity run.openai/whisper-base.en under
Apache-2.0. This repository claims no ownership of the model or its weights. It
is a format conversion and packaging of that model: the same parameters, in
ONNX, with attention outputs exposed. CreatorMission's contribution is the
conversion configuration and packaging, offered under the same licence.1@misc{radford2022whisper,
2 title = {Robust Speech Recognition via Large-Scale Weak Supervision},
3 author = {Alec Radford and Jong Wook Kim and Tao Xu and Greg Brockman
4 and Christine McLeavey and Ilya Sutskever},
5 year = {2022},
6 eprint = {2212.04356},
7 archivePrefix = {arXiv}
8}NOTICE for the attribution notice required by Apache-2.0 §4(d).