cjpais/Handy · error · anyhow::Error

Moonshine transcription failed

Error message

Moonshine transcription failed: {}

What it means

The Moonshine branch calls moonshine_engine.transcribe(&audio, &TranscribeOptions::default()); this error wraps an ONNX Runtime failure during Moonshine inference, with the library error chained after the colon.

Solutions

  1. Read the chained ORT error to classify provider vs graph failure
  2. Switch ONNX accelerator to CPU and retry
  3. Re-download the Moonshine model if graph loading is implicated
  4. Test with a longer recording to rule out too-short input
Defensive patterns

Strategy: retry

Try / catch

let attempt = manager.transcribe(audio.clone());
let text = match attempt {
    Err(e) if e.to_string().contains("Moonshine transcription failed") => {
        manager.transcribe(audio)? // one retry; provider glitches are usually transient
    }
    r => r?,
};

Prevention

When it happens

Trigger: transcribe() runs with LoadedEngine::Moonshine and ORT inference errors: execution provider failure, invalid input shape from degenerate audio (e.g. empty after VAD trim), or a corrupted model graph.

Common situations: Driver/GPU instability; extremely short recordings; model file corrupted after an interrupted re-download; onnxruntime dylib mismatch after system update.

Related errors


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

Appendix: source

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

                            })
                            .map_err(|e| {
                                anyhow::anyhow!("transcribe-cpp transcription failed: {}", e)
                            })
                    }
                    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,

View on GitHub (pinned to ba10ce1943)