{"record":{"id":"04096e15bd23b1de","repo":"cjpais/Handy","slug":"failed-to-load-moonshine-streaming-model","errorCode":null,"errorMessage":"Failed to load moonshine streaming model {}: {}","messagePattern":"Failed to load moonshine streaming model (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":670,"sourceCode":"                    MoonshineVariant::Base,\n                    &Quantization::default(),\n                )\n                .map_err(|e| {\n                    let error_msg = format!(\"Failed to load moonshine model {}: {}\", model_id, e);\n                    emit_loading_failed(&error_msg);\n                    anyhow::anyhow!(error_msg)\n                })?;\n                LoadedEngine::Moonshine(engine)\n            }\n            EngineType::MoonshineStreaming => {\n                let engine = StreamingModel::load(&model_path, 0, &Quantization::default())\n                    .map_err(|e| {\n                        let error_msg = format!(\n                            \"Failed to load moonshine streaming model {}: {}\",\n                            model_id, e\n                        );\n                        emit_loading_failed(&error_msg);\n                        anyhow::anyhow!(error_msg)\n                    })?;\n                LoadedEngine::MoonshineStreaming(engine)\n            }\n            EngineType::SenseVoice => {\n                let engine =\n                    SenseVoiceModel::load(&model_path, &Quantization::Int8).map_err(|e| {\n                        let error_msg =\n                            format!(\"Failed to load SenseVoice model {}: {}\", model_id, e);\n                        emit_loading_failed(&error_msg);\n                        anyhow::anyhow!(error_msg)\n                    })?;\n                LoadedEngine::SenseVoice(engine)\n            }\n            EngineType::GigaAM => {\n                let engine = GigaAMModel::load(&model_path, &Quantization::Int8).map_err(|e| {\n                    let error_msg = format!(\"Failed to load gigaam model {}: {}\", model_id, e);\n                    emit_loading_failed(&error_msg);\n                    anyhow::anyhow!(error_msg)","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/managers/transcription.rs#L652-L688","documentation":"Thrown when StreamingModel::load from transcribe-rs fails to load the streaming Moonshine ONNX model at model_path (variant index 0, default quantization). The ONNX Runtime error is chained after the model_id and a \"loading_failed\" model-state event is emitted before the anyhow error is returned.","triggerScenarios":"load_model hits EngineType::MoonshineStreaming and StreamingModel::load(&model_path, 0, &Quantization::default()) errors: streaming-variant files absent or corrupt under model_path, a base-variant directory used where the streaming layout is expected, or ONNX Runtime session creation fails.","commonSituations":"Corrupted/partial download of the streaming model; switching between Moonshine and Moonshine Streaming while files were half-written; version change in transcribe-rs expecting different streaming file names; missing onnxruntime provider libraries on Linux.","solutions":["Re-download the Moonshine streaming model from the model selector","Confirm the model directory actually contains the streaming-variant ONNX files and they are non-empty","Check the chained ONNX Runtime message for provider errors; try CPU accelerator","Fall back to the non-streaming Moonshine model while the streaming files are repaired"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !model_path.join(\"model.onnx\").exists() {\n    // streaming variant files missing: trigger re-download before load\n    model_manager.ensure_downloaded(&model_id).await?;\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = manager.load_model(&model_id, None) {\n    if e.to_string().contains(\"moonshine streaming\") {\n        // re-download then retry once; surface persistent failures to the user\n    }\n}","preventionTips":["Treat streaming model files as opaque — only delete via the model selector UI","Avoid switching Moonshine variants while a download is in progress","Watch for loading_failed events and re-download promptly instead of retrying loads on corrupt files"],"tags":["rust","onnx","moonshine","streaming","model-loading","transcribe-rs"],"backgroundTag":"onnx-model-load-failed","analyzedSha":"ba10ce1943ef34e93c09494027fc0b9ced2e8a44","analyzedAt":"2026-08-17T10:29:55.597Z","contentChangedAt":"2026-08-17T10:29:55.597Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}