{"record":{"id":"ab6bcbb50e426cce","repo":"cjpais/Handy","slug":"parakeet-transcription-failed","errorCode":null,"errorMessage":"Parakeet transcription failed: {}","messagePattern":"Parakeet transcription failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":1337,"sourceCode":"                            .map(|t| {\n                                // Whisper's audio-based LID (auto mode only;\n                                // `None` when a language hint was passed).\n                                model_detected_language = t.language;\n                                t.text\n                            })\n                            .map_err(|e| {\n                                anyhow::anyhow!(\"transcribe-cpp transcription failed: {}\", e)\n                            })\n                    }\n                    LoadedEngine::Parakeet(parakeet_engine) => {\n                        let params = ParakeetParams {\n                            timestamp_granularity: Some(TimestampGranularity::Segment),\n                            ..Default::default()\n                        };\n                        parakeet_engine\n                            .transcribe_with(&audio, &params)\n                            .map(|r| r.text)\n                            .map_err(|e| anyhow::anyhow!(\"Parakeet transcription failed: {}\", e))\n                    }\n                    LoadedEngine::Moonshine(moonshine_engine) => moonshine_engine\n                        .transcribe(&audio, &TranscribeOptions::default())\n                        .map(|r| r.text)\n                        .map_err(|e| anyhow::anyhow!(\"Moonshine transcription failed: {}\", e)),\n                    LoadedEngine::MoonshineStreaming(streaming_engine) => streaming_engine\n                        .transcribe(&audio, &TranscribeOptions::default())\n                        .map(|r| r.text)\n                        .map_err(|e| {\n                            anyhow::anyhow!(\"Moonshine streaming transcription failed: {}\", e)\n                        }),\n                    LoadedEngine::SenseVoice(sense_voice_engine) => {\n                        let language = match normalize_cjk_language(&validated_language) {\n                            \"zh\" => Some(\"zh\".to_string()),\n                            \"en\" => Some(\"en\".to_string()),\n                            \"ja\" => Some(\"ja\".to_string()),\n                            \"ko\" => Some(\"ko\".to_string()),\n                            \"yue\" => Some(\"yue\".to_string()),","sourceCodeStart":1319,"sourceCodeEnd":1355,"githubUrl":"https://github.com/cjpais/Handy/blob/98a4d80cce8ad41efec2a419b59d9e81229a35d7/src-tauri/src/managers/transcription.rs#L1319-L1355","documentation":"ParakeetModel::transcribe_with failed during ONNX inference. The wrapped error is an ONNX Runtime failure from transcribe-rs: session run error, execution-provider failure (GPU EP unavailable/dropped), invalid input shape (audio too short/empty after VAD filtering), or a corrupted model file. The engine is returned to the slot afterwards, so the model remains loaded — only this transcription failed.","triggerScenarios":"parakeet_engine.transcribe_with(&audio, &ParakeetParams { timestamp_granularity: Segment, ..Default }) errors: OrtError on session run, GPU execution provider failing at runtime, audio vector degenerate (near-zero length after VAD), or model artifacts damaged on disk.","commonSituations":"Very short recordings that VAD reduces to a few ms of audio; ONNX runtime provider DLL/so missing after an app update; model folder partially deleted; GPU drivers flaky; memory pressure from other apps evicting the EP.","solutions":["Retry the recording — transient ORT/provider faults often clear","Record a slightly longer utterance so post-VAD audio is not degenerate","Re-download the Parakeet model if errors persist on every attempt","Check available RAM/VRAM and close competing GPU-heavy apps","Update Handy so the bundled ort matches the model artifacts"],"exampleFix":"// before\nparakeet_engine.transcribe_with(&audio, &params).map_err(|e| anyhow::anyhow!(\"Parakeet transcription failed: {}\", e))?;\n\n// after — guard degenerate audio, retry once on failure\nanyhow::ensure!(audio.len() >= 1600, \"audio too short for Parakeet ({} samples)\", audio.len()); // ~100ms @16k\nlet result = match parakeet_engine.transcribe_with(&audio, &params) {\n    Ok(r) => r,\n    Err(e) => { warn!(\"parakeet attempt failed ({}), retrying\", e); parakeet_engine.transcribe_with(&audio, &params)? }\n};","handlingStrategy":"try-catch","validationCode":"// Guard degenerate input before calling the engine\nanyhow::ensure!(audio.len() >= 1600, \"audio too short after VAD ({} samples)\", audio.len());\nanyhow::ensure!(audio.iter().all(|s| s.is_finite()), \"non-finite audio\");","typeGuard":null,"tryCatchPattern":"match tm.transcribe(audio.clone()) {\n    Err(e) if e.to_string().contains(\"Parakeet transcription failed\") => {\n        if is_transient_ort_error(&e) { tm.transcribe(audio) } else { reDownloadModel_and_retry(&model_id, audio) }\n    }\n    other => other,\n}","preventionTips":["Record utterances of at least ~1s so VAD never starves the engine","Keep memory headroom; close GPU-heavy apps during transcription","Re-download Parakeet after partial downloads rather than retrying loads","Stay current with Handy updates so ort/provider versions match artifacts"],"tags":["rust","onnx","parakeet","inference","transcribe-rs"],"backgroundTag":"onnx-inference-failed","analyzedSha":"98a4d80cce8ad41efec2a419b59d9e81229a35d7","analyzedAt":"2026-08-16T20:58:09.966Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}