cjpais/Handy · error · anyhow::Error

Canary transcription failed

Error message

Canary transcription failed: {}

What it means

The Canary branch sets translate from settings.translate_to_english, builds TranscribeOptions { language, translate, ..default } and calls transcribe; this error wraps the ONNX Runtime failure. Note this path records output_was_translated so downstream language detection knows the output is English.

Solutions

  1. Check the chained ORT message; toggle translate_to_english off and retry to isolate the option
  2. Switch accelerator to CPU if a provider error is shown
  3. Re-download the Canary model
  4. Retry with a longer recording
Defensive patterns

Strategy: try-catch

Validate before calling

// before transcribe(): guard the translate option against the model's capabilities
if model_info.engine_type == EngineType::Canary && !caps.supports_translate {
    settings.translate_to_english = false;
}

Try / catch

if let Err(e) = manager.transcribe(audio.clone()) {
    if e.to_string().contains("Canary transcription failed") && settings.translate_to_english {
        settings.translate_to_english = false; // isolate the option, retry
        return manager.transcribe(audio);
    }
    return Err(e);
}

Prevention

When it happens

Trigger: canary_engine.transcribe errors during inference: ORT provider failure, unsupported language string combination with translate enabled, degenerate audio, or corrupt graph files.

Common situations: Translate-to-English enabled with a language the model handles poorly; GPU provider issues; corrupted download.

Related errors


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

Appendix: source

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

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

View on GitHub (pinned to ba10ce1943)