Skip to content

fix(voice-to-text): per-module dtype so the Whisper session loads - #72

Merged
slaveofcode merged 1 commit into
developfrom
fix/voice-to-text-dtype
Aug 1, 2026
Merged

fix(voice-to-text): per-module dtype so the Whisper session loads#72
slaveofcode merged 1 commit into
developfrom
fix/voice-to-text-dtype

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Reported: Can't create a session … MatMulNBits Missing required scale: model.decoder.embed_tokens.weight …

Cause: Whisper is encoder-decoder. A single-string dtype: 'q8' (the WASM default) left the decoder (which holds embed_tokens) on a 4-bit MatMulNBits variant whose scale tensor the bundled ONNX Runtime can't resolve → session creation fails.

Fix: per-module dtype — force decoder_model_merged: 'fp32' (unquantized, valid scales); encoder stays q8 on WASM / fp32 on WebGPU to limit the download.

Not headless-verifiable (needs real model download in a browser) — needs a smoke test after deploy.

🤖 Generated with Claude Code

Reported: 'Can't create a session … MatMulNBits Missing required scale:
model.decoder.embed_tokens.weight … DequantizeLinear'.

Whisper is an encoder-decoder model. A single-string dtype ('q8', the WASM
default) left the decoder — which holds embed_tokens — on a 4-bit (MatMulNBits)
variant whose scale tensor the bundled ONNX Runtime can't resolve, so the
session fails to create. Switch to a per-module dtype and force
decoder_model_merged to fp32 (unquantized, proper scales); the encoder stays
q8 on WASM / fp32 on WebGPU to limit the download.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@slaveofcode
slaveofcode merged commit 51d577d into develop Aug 1, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the fix/voice-to-text-dtype branch August 1, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant