{"record":{"id":"bd80dbe3919c708b","repo":"cjpais/Handy","slug":"failed-to-load-cohere-model","errorCode":null,"errorMessage":"Failed to load cohere model {}: {}","messagePattern":"Failed to load cohere model (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":704,"sourceCode":"                    let error_msg = format!(\"Failed to load gigaam model {}: {}\", model_id, e);\n                    emit_loading_failed(&error_msg);\n                    anyhow::anyhow!(error_msg)\n                })?;\n                LoadedEngine::GigaAM(engine)\n            }\n            EngineType::Canary => {\n                let engine = CanaryModel::load(&model_path, &Quantization::Int8).map_err(|e| {\n                    let error_msg = format!(\"Failed to load canary model {}: {}\", model_id, e);\n                    emit_loading_failed(&error_msg);\n                    anyhow::anyhow!(error_msg)\n                })?;\n                LoadedEngine::Canary(engine)\n            }\n            EngineType::Cohere => {\n                let engine = CohereModel::load(&model_path, &Quantization::Int8).map_err(|e| {\n                    let error_msg = format!(\"Failed to load cohere model {}: {}\", model_id, e);\n                    emit_loading_failed(&error_msg);\n                    anyhow::anyhow!(error_msg)\n                })?;\n                LoadedEngine::Cohere(engine)\n            }\n        };\n\n        // Update the current engine and model ID\n        {\n            let mut engine = self.lock_engine();\n            *engine = Some(loaded_engine);\n        }\n        {\n            let mut current_model = self.current_model_id.lock().unwrap();\n            *current_model = Some(model_id.to_string());\n        }\n\n        // Reset idle timer so the watcher doesn't immediately unload a just-loaded model\n        self.touch_activity();\n","sourceCodeStart":686,"sourceCodeEnd":722,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/managers/transcription.rs#L686-L722","documentation":"Thrown when CohereModel::load fails to load the Cohere ONNX model (Int8 quantization) from model_path. The error message embeds the model_id and the chained ONNX Runtime error, and a \"loading_failed\" model-state event is emitted before load_model returns the anyhow error.","triggerScenarios":"EngineType::Cohere branch calls CohereModel::load(&model_path, &Quantization::Int8) and it errors: corrupt/incomplete model files, missing Int8 variant, or ONNX Runtime execution provider failure.","commonSituations":"Download cut short by sleep/network loss; models directory moved or cleaned; onnxruntime version incompatible with the model opset after an app update.","solutions":["Re-download the Cohere model","Validate the model directory files exist and are non-trivial in size","Address the chained ONNX Runtime error (provider/accelerator switch to CPU)","Check logs from ModelManager for the original download result"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match manager.load_model(&model_id, None) {\n    Ok(()) => {}\n    Err(e) => { /* re-download, single retry, then suggest another engine */ }\n}","preventionTips":["Complete downloads in one session","Keep the models directory on reliable storage","Handle loading_failed events in the frontend flow"],"tags":["rust","onnx","cohere","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"}