{"record":{"id":"256e002bb5044ffb","repo":"cjpais/Handy","slug":"failed-to-load-gigaam-model","errorCode":null,"errorMessage":"Failed to load gigaam model {}: {}","messagePattern":"Failed to load gigaam model (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":662,"sourceCode":"                        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)\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)","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/cjpais/Handy/blob/98a4d80cce8ad41efec2a419b59d9e81229a35d7/src-tauri/src/managers/transcription.rs#L644-L680","documentation":"Thrown when GigaAMModel::load fails to instantiate the Int8 GigaAM ONNX engine from the model files at model_path. The underlying transcribe-rs/ort error indicates the artifacts could not be turned into a session — missing or truncated files, incompatible artifact version, or an execution-provider/memory failure. Handy attaches the model_id, emits the loading_failed model-state-changed event, and leaves no engine loaded.","triggerScenarios":"load_model() hits EngineType::GigaAM and GigaAMModel::load(&model_path, &Quantization::Int8) errors: model dir missing the GigaAM .onnx files, partial download, ort provider/dependency missing, or not enough memory to hold the session.","commonSituations":"Download interrupted by network drop or app exit; disk nearly full; security software removing .onnx files; Handy update bundling a transcribe-rs version whose artifact format changed; small-RAM machines or many GPU apps competing for memory.","solutions":["Remove and re-download the GigaAM model so ModelManager restores complete artifacts","Check the model directory contents and file sizes against the model registry","Verify disk space and AV quarantine logs, then retry the download","Test with another model to confirm the runtime path is otherwise healthy","Update Handy so bundled runtime and model artifacts match"],"exampleFix":"// before\nlet engine = GigaAMModel::load(&model_path, &Quantization::Int8);\n\n// after — guard the load with a size check and actionable error\nlet onnx_total: u64 = std::fs::read_dir(&model_path)?\n    .filter_map(|e| e.ok())\n    .map(|e| e.metadata().map(|m| m.len()).unwrap_or(0))\n    .sum();\nanyhow::ensure!(onnx_total > 0, \"GigaAM artifacts missing in {} — re-download the model\", model_path.display());\nlet engine = GigaAMModel::load(&model_path, &Quantization::Int8)?;","handlingStrategy":"validation","validationCode":"// Before loading GigaAM, sanity-check the pack size against the registry expectation\nlet path = model_manager.get_model_path(model_id)?;\nlet expected = model_manager.get_model_info(model_id).map(|i| i.size_bytes).unwrap_or(0);\nlet actual: u64 = std::fs::read_dir(&path)?.filter_map(|e| e.ok())\n    .map(|e| e.metadata().map(|m| m.len()).unwrap_or(0)).sum();\nanyhow::ensure!(expected == 0 || actual >= expected, \"GigaAM incomplete: {} of {} bytes\", actual, expected);","typeGuard":null,"tryCatchPattern":"match tm.load_model(&model_id) {\n    Err(e) if e.to_string().contains(\"Failed to load gigaam model\") => {\n        model_manager.remove_local_model(&model_id)?;\n        tm.load_model(&model_id)?\n    }\n    other => other?,\n}","preventionTips":["Re-download immediately after any interrupted download instead of retrying the load on partial files","Monitor disk space during model fetches","Use the model selector's size/hash verification (if available) after downloads","Keep a known-good fallback model selected for automation paths"],"tags":["rust","tauri","onnx","model-loading","gigaam","transcribe-rs"],"backgroundTag":"onnx-model-load-failed","analyzedSha":"98a4d80cce8ad41efec2a419b59d9e81229a35d7","analyzedAt":"2026-08-16T20:58:09.966Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}