cjpais/Handy · error · anyhow::Error

SenseVoice transcription failed

Error message

SenseVoice transcription failed: {}

What it means

The SenseVoice branch builds SenseVoiceParams { language (zh/en/ja/ko/yue or None), use_itn: true } and calls transcribe_with; this error wraps the ONNX Runtime inference failure with the library error chained.

Solutions

  1. Inspect the chained ORT error; switch accelerator to CPU when a provider error is shown
  2. Retry with a longer recording
  3. Re-download the SenseVoice model if the graph errors
  4. Update the app for onnxruntime/transcribe-rs compatibility fixes
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(e) = manager.transcribe(audio) {
    if e.to_string().contains("SenseVoice transcription failed") && e.to_string().contains("provider") {
        settings.ort_accelerator = OrtAcceleratorSetting::Cpu; // remediate and retry
        return manager.transcribe(audio);
    }
    return Err(e);
}

Prevention

When it happens

Trigger: sense_voice_engine.transcribe_with errors: execution provider failure, degenerate/short audio, or graph/tensor errors from the Int8 model; the language hint itself is sanitized to a supported set or None before the call, so failures come from inference, not the hint value.

Common situations: GPU provider flakiness after driver updates; recordings trimmed to near-zero by VAD; corrupted Int8 model files.

Related errors


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

Appendix: source

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

                        }),
                    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)
                            .map_err(|e| anyhow::anyhow!("SenseVoice transcription failed: {}", e))
                    }
                    LoadedEngine::GigaAM(gigaam_engine) => gigaam_engine
                        .transcribe(&audio, &TranscribeOptions::default())
                        .map(|r| r.text)
                        .map_err(|e| anyhow::anyhow!("GigaAM transcription failed: {}", e)),
                    LoadedEngine::Canary(canary_engine) => {
                        output_was_translated = settings.translate_to_english;
                        let lang = if validated_language == "auto" {
                            None
                        } else {
                            Some(validated_language.clone())
                        };
                        applied_language_hint = lang.clone();
                        let options = TranscribeOptions {
                            language: lang,
                            translate: settings.translate_to_english,
                            ..Default::default()
                        };

View on GitHub (pinned to ba10ce1943)