{"record":{"id":"94cd8548b9615e67","repo":"cjpais/Handy","slug":"canary-transcription-failed","errorCode":null,"errorMessage":"Canary transcription failed: {}","messagePattern":"Canary transcription failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":1388,"sourceCode":"                        .map(|r| r.text)\n                        .map_err(|e| anyhow::anyhow!(\"GigaAM transcription failed: {}\", e)),\n                    LoadedEngine::Canary(canary_engine) => {\n                        output_was_translated = settings.translate_to_english;\n                        let lang = if validated_language == \"auto\" {\n                            None\n                        } else {\n                            Some(validated_language.clone())\n                        };\n                        applied_language_hint = lang.clone();\n                        let options = TranscribeOptions {\n                            language: lang,\n                            translate: settings.translate_to_english,\n                            ..Default::default()\n                        };\n                        canary_engine\n                            .transcribe(&audio, &options)\n                            .map(|r| r.text)\n                            .map_err(|e| anyhow::anyhow!(\"Canary transcription failed: {}\", e))\n                    }\n                    LoadedEngine::Cohere(cohere_engine) => {\n                        let lang = if validated_language == \"auto\" {\n                            None\n                        } else {\n                            Some(normalize_cjk_language(&validated_language).to_string())\n                        };\n                        applied_language_hint = lang.clone();\n                        let options = TranscribeOptions {\n                            language: lang,\n                            ..Default::default()\n                        };\n                        cohere_engine\n                            .transcribe(&audio, &options)\n                            .map(|r| r.text)\n                            .map_err(|e| anyhow::anyhow!(\"Cohere transcription failed: {}\", e))\n                    }\n                }","sourceCodeStart":1370,"sourceCodeEnd":1406,"githubUrl":"https://github.com/cjpais/Handy/blob/98a4d80cce8ad41efec2a419b59d9e81229a35d7/src-tauri/src/managers/transcription.rs#L1370-L1406","documentation":"CanaryModel::transcribe failed during ONNX inference. Handy sets output_was_translated from settings.translate_to_english and builds TranscribeOptions { language (None when 'auto'), translate, ..default } before the call; a failure is an ONNX Runtime error from transcribe-rs — session run fault, provider failure, degenerate audio, or corrupt Int8 artifacts. The engine remains loaded; only the transcription is lost.","triggerScenarios":"canary_engine.transcribe(&audio, &options) errors: ORT run failure; audio too short after VAD; translate enabled on a machine/provider that fails mid-decode; corrupted model files; memory exhaustion.","commonSituations":"Short clips trimmed by VAD; translate-to-English enabled with flaky GPU providers; partial downloads or quarantined artifacts; low RAM/VRAM while multitasking.","solutions":["Retry the recording, ideally with translate-to-English off to isolate the option","Record longer audio so post-VAD input is non-degenerate","Re-download the Canary model if failures are consistent","Free memory/GPU resources and retry","Update Handy for runtime compatibility fixes"],"exampleFix":"// before\nlet r = canary_engine.transcribe(&audio, &options)?; // options.translate may be on\n\n// after — retry without translation if the translated run fails\nlet r = match canary_engine.transcribe(&audio, &options) {\n    Ok(r) => r,\n    Err(e) if options.translate => {\n        warn!(\"Canary translate run failed ({}), retrying without translate\", e);\n        canary_engine.transcribe(&audio, &TranscribeOptions::default())?\n    }\n    Err(e) => return Err(anyhow::anyhow!(\"Canary transcription failed: {}\", e)),\n};","handlingStrategy":"try-catch","validationCode":"anyhow::ensure!(audio.len() >= 1600, \"audio too short for Canary\");\nanyhow::ensure!(audio.iter().all(|s| s.is_finite()), \"non-finite audio\");\n// If translate is on, verify the loaded model supports it (model_info runtime capabilities)","typeGuard":null,"tryCatchPattern":"match tm.transcribe(audio.clone()) {\n    Err(e) if e.to_string().contains(\"Canary transcription failed\") && settings.translate_to_english => {\n        set_translate(false); tm.transcribe(audio) // isolate the translate path\n    }\n    Err(e) if e.to_string().contains(\"Canary transcription failed\") => reDownloadModel_and_retry(&model_id, audio),\n    other => other,\n}","preventionTips":["Disable translate-to-English while diagnosing Canary failures","Record long enough clips; verify audio is finite post-resample","Re-download Canary after partial downloads","Match language settings to the model's supported set"],"tags":["rust","onnx","canary","inference","transcribe-rs","translation"],"backgroundTag":"onnx-inference-failed","analyzedSha":"98a4d80cce8ad41efec2a419b59d9e81229a35d7","analyzedAt":"2026-08-16T20:58:09.966Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}