cjpais/Handy · error · anyhow::Error

Moonshine streaming transcription failed

Error message

Moonshine streaming transcription failed: {}

What it means

The MoonshineStreaming branch runs the streaming engine in batch mode via streaming_engine.transcribe(&audio, &TranscribeOptions::default()); this error wraps an ONNX Runtime failure specific to the streaming-variant graph, chained after the colon.

Solutions

  1. Check the chained ORT message; switch accelerator to CPU if a provider error appears
  2. Re-download the streaming model if graph errors persist
  3. Prefer the non-streaming Moonshine model for batch workloads
  4. Retry — transient provider failures often clear on a fresh session
Defensive patterns

Strategy: retry

Try / catch

match manager.transcribe(audio.clone()) {
    Err(e) if e.to_string().contains("Moonshine streaming transcription failed") => {
        // streaming graph in batch mode can be finicky: retry once, then suggest the non-streaming model
        manager.transcribe(audio)
    }
    other => other,
}

Prevention

When it happens

Trigger: Batch transcription is attempted on the streaming-variant engine (e.g. fallback after a stream was never active) and ORT inference fails: provider error, shape mismatch because streaming graphs expect chunked input, or corrupt model files.

Common situations: Fallback-to-batch path exercising the streaming model with unusual audio lengths; GPU provider issues; partially downloaded streaming model.

Related errors


AI-assisted analysis of cjpais/Handy@ba10ce1943 (2026-08-17). Data as JSON: /api/errors/731de7f21836a32e. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/managers/transcription.rs:1373

                    LoadedEngine::Parakeet(parakeet_engine) => {
                        let params = ParakeetParams {
                            timestamp_granularity: Some(TimestampGranularity::Segment),
                            ..Default::default()
                        };
                        parakeet_engine
                            .transcribe_with(&audio, &params)
                            .map(|r| r.text)
                            .map_err(|e| anyhow::anyhow!("Parakeet transcription failed: {}", e))
                    }
                    LoadedEngine::Moonshine(moonshine_engine) => moonshine_engine
                        .transcribe(&audio, &TranscribeOptions::default())
                        .map(|r| r.text)
                        .map_err(|e| anyhow::anyhow!("Moonshine transcription failed: {}", e)),
                    LoadedEngine::MoonshineStreaming(streaming_engine) => streaming_engine
                        .transcribe(&audio, &TranscribeOptions::default())
                        .map(|r| r.text)
                        .map_err(|e| {
                            anyhow::anyhow!("Moonshine streaming transcription failed: {}", e)
                        }),
                    LoadedEngine::SenseVoice(sense_voice_engine) => {
                        let language = match normalize_cjk_language(&validated_language) {
                            "zh" => Some("zh".to_string()),
                            "en" => Some("en".to_string()),
                            "ja" => Some("ja".to_string()),
                            "ko" => Some("ko".to_string()),
                            "yue" => Some("yue".to_string()),
                            _ => None,
                        };
                        applied_language_hint = language.clone();
                        let params = SenseVoiceParams {
                            language,
                            use_itn: Some(true),
                        };
                        sense_voice_engine
                            .transcribe_with(&audio, &params)
                            .map(|r| r.text)

View on GitHub (pinned to ba10ce1943)