Bug
The automatic-speech-recognition pipeline crashes at decode time for all moonshine models (e.g. onnx-community/moonshine-tiny-ar-ONNX, onnx-community/moonshine-tiny-en-ONNX), in both 3.8.1 and 4.2.0.
Exact error
Error: Unable to decode without a tokenizer.
at Function.batch_decode (transformers.node.mjs:15763)
at Function._call_moonshine (transformers.node.mjs:32216)
Reproduce (Node, v4.2.0)
import { pipeline, env } from "@huggingface/transformers";
env.allowLocalModels = false;
const transcriber = await pipeline("automatic-speech-recognition", "onnx-community/moonshine-tiny-ar-ONNX", { dtype: "q8", device: "cpu" });
// model loads fine (~3s)
const out = await transcriber(float32Audio16k); // throws at decode
Root cause
_call_moonshine calls the processor's batch_decode:
// src/pipelines/automatic-speech-recognition.js:328 (v4.2.0)
const text = this.processor.batch_decode(outputs, { skip_special_tokens: true })[0];
But the moonshine processor is constructed without a tokenizer — only a feature_extractor. Verified directly:
const proc = await AutoProcessor.from_pretrained("onnx-community/moonshine-tiny-ar-ONNX");
// proc.components => ['feature_extractor'] (no 'tokenizer')
// proc.config.processor_class => undefined
// proc.config.auto_map => undefined
So processor.batch_decode hits its if (!this.tokenizer) throw guard (processing_utils.js:94).
The pipeline-level tokenizer is correctly populated:
const p = await pipeline("automatic-speech-recognition", "onnx-community/moonshine-tiny-ar-ONNX", {...});
// p.tokenizer => PreTrainedTokenizer (loaded from tokenizer.json) ✓
// p.processor.tokenizer => undefined ✗
Fix
_call_moonshine should use the pipeline's tokenizer, not the processor's:
const text = this.tokenizer.batch_decode(outputs, { skip_special_tokens: true })[0];
This matches every other ASR path — _call_whisper uses this.tokenizer._decode_asr, and _call_wav2vec2 uses this.tokenizer.decode. _call_moonshine is the only one that routes through this.processor, and the processor legitimately may not carry a tokenizer.
Environment
@huggingface/transformers: 3.8.1 (reproduced) and 4.2.0 (reproduced)
- Model:
onnx-community/moonshine-tiny-ar-ONNX (and the en variant)
- Runtime: Node 22 (onnxruntime-node cpu) and browser (onnxruntime-web wasm)
Thank you.
Bug
The
automatic-speech-recognitionpipeline crashes at decode time for all moonshine models (e.g.onnx-community/moonshine-tiny-ar-ONNX,onnx-community/moonshine-tiny-en-ONNX), in both 3.8.1 and 4.2.0.Exact error
Reproduce (Node, v4.2.0)
Root cause
_call_moonshinecalls the processor'sbatch_decode:But the moonshine processor is constructed without a tokenizer — only a feature_extractor. Verified directly:
So
processor.batch_decodehits itsif (!this.tokenizer) throwguard (processing_utils.js:94).The pipeline-level tokenizer is correctly populated:
Fix
_call_moonshineshould use the pipeline's tokenizer, not the processor's:This matches every other ASR path —
_call_whisperusesthis.tokenizer._decode_asr, and_call_wav2vec2usesthis.tokenizer.decode._call_moonshineis the only one that routes throughthis.processor, and the processor legitimately may not carry a tokenizer.Environment
@huggingface/transformers: 3.8.1 (reproduced) and 4.2.0 (reproduced)onnx-community/moonshine-tiny-ar-ONNX(and the en variant)Thank you.