{"record":{"id":"710a6880c392bed6","repo":"cjpais/Handy","slug":"transcribe-cpp-transcription-failed","errorCode":null,"errorMessage":"transcribe-cpp transcription failed: {}","messagePattern":"transcribe-cpp transcription failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":1326,"sourceCode":"                        };\n\n                        debug!(\n                            \"transcribe-cpp run: task={:?}, language={:?}, initial_prompt={}\",\n                            run_options.task,\n                            run_options.language,\n                            run_options.family.is_some()\n                        );\n\n                        session\n                            .run(&audio, &run_options)\n                            .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())","sourceCodeStart":1308,"sourceCodeEnd":1344,"githubUrl":"https://github.com/cjpais/Handy/blob/98a4d80cce8ad41efec2a419b59d9e81229a35d7/src-tauri/src/managers/transcription.rs#L1308-L1344","documentation":"The transcribe-cpp (Whisper/GGUF) session's run() call failed during inference. The wrapped error comes from the GGML backend layer: compute failure on the selected backend (Vulkan/CUDA/Metal), out-of-memory loading activations for the chosen model, corrupted GGUF metadata, or a run-options mismatch against the loaded architecture. It is returned from transcribe() after the engine is safely returned to the slot, so the model stays loaded.","triggerScenarios":"session.run(&audio, &run_options) errors for the LoadedEngine::TranscribeCpp arm: GPU backend failure (device lost, driver crash, Vulkan surface issues), VRAM/RAM exhaustion with large GGUF models, truncated/corrupt GGUF file, or run options (translate / initial prompt extension) rejected by the loaded non-whisper arch despite capability gating.","commonSituations":"Selecting a large Whisper model on a GPU with insufficient VRAM; outdated or crashing GPU drivers (especially Vulkan on Linux); model file corrupted after a partial download; running under emulation (Windows x64 on ARM64) where GPU is force-disabled; very long audio clips spiking memory.","solutions":["Switch the accelerator setting to CPU and retry — this isolates/dodges GPU backend and VRAM issues","Use a smaller model (Small instead of Large/Turbo) if memory is the constraint","Re-download the GGUF model in case the file is corrupt","Update GPU drivers; on Linux run with VK_LOADER_DEBUG=error to surface Vulkan loader faults, or try --list-devices to verify the device registry","Update Handy — arch/run-options mismatches (e.g. #1601 voxtral rejections) are fixed over time"],"exampleFix":"// before\nsession.run(&audio, &run_options).map_err(|e| anyhow::anyhow!(\"transcribe-cpp transcription failed: {}\", e))?;\n\n// after — validate input first, and retry on CPU when a GPU backend fails\nanyhow::ensure!(audio.iter().all(|s| s.is_finite()), \"audio contains NaN/inf samples\");\nlet text = match session.run(&audio, &run_options) {\n    Ok(t) => t,\n    Err(e) if backend_is_gpu(session.backend()) => {\n        warn!(\"GPU inference failed ({}), retrying on CPU\", e);\n        reload_model_on_cpu_and_retry(&audio, &run_options)?\n    }\n    Err(e) => return Err(anyhow::anyhow!(\"transcribe-cpp transcription failed: {}\", e)),\n};","handlingStrategy":"try-catch","validationCode":"// Validate audio before inference and confirm the backend is sane\nanyhow::ensure!(!audio.is_empty(), \"empty audio\");\nanyhow::ensure!(audio.iter().all(|s| s.is_finite()), \"audio has NaN/inf samples\");\n// Optionally check backend registered: transcribe_cpp::backend_available(Backend::Vulkan)","typeGuard":null,"tryCatchPattern":"match tm.transcribe(audio.clone()) {\n    Err(e) if e.to_string().contains(\"transcribe-cpp transcription failed\") => {\n        // GPU/OOM flake: switch accelerator to CPU once and retry\n        set_accelerator_setting(TranscribeAcceleratorSetting::Cpu);\n        tm.reload_model();\n        tm.transcribe(audio)\n    }\n    other => other,\n}","preventionTips":["Choose model sizes that fit comfortably in VRAM (leave headroom for other GPU apps)","Keep GPU drivers updated; on Linux verify Vulkan with --list-devices and VK_LOADER_DEBUG=error","Re-download GGUF models after interrupted downloads instead of retrying loads on partial files","Update Handy when new architectures are added — run-option mismatches get gated over time"],"tags":["rust","ggml","whisper","transcribe-cpp","inference","gpu"],"backgroundTag":"whisper-inference-failed","analyzedSha":"98a4d80cce8ad41efec2a419b59d9e81229a35d7","analyzedAt":"2026-08-16T20:58:09.966Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}