{"record":{"id":"1cb4a97ae38c8574","repo":"tonhowtf/omniget","slug":"modelo-nao-esta-baixado","errorCode":null,"errorMessage":"modelo {} nao esta baixado","messagePattern":"modelo (.+?) nao esta baixado","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/whisper.rs","lineNumber":324,"sourceCode":"                text: t,\n            });\n        }\n    }\n    Ok((language, cues))\n}\n\npub async fn transcribe(\n    opts: TranscribeOptions,\n    progress: ProgressFn,\n) -> anyhow::Result<TranscribeResult> {\n    let (bin, _) = locate()\n        .await\n        .ok_or_else(|| anyhow!(\"whisper-cli nao esta instalado\"))?;\n    let model_path = models_dir()\n        .ok_or_else(|| anyhow!(\"Could not determine data directory\"))?\n        .join(format!(\"ggml-{}.bin\", opts.model));\n    if !model_path.exists() {\n        return Err(anyhow!(\"modelo {} nao esta baixado\", opts.model));\n    }\n    let input = PathBuf::from(&opts.input);\n    if !input.exists() {\n        return Err(anyhow!(\"arquivo nao encontrado: {}\", opts.input));\n    }\n    let id = format!(\"transcribe:{}\", opts.input);\n    report(&progress, &id, \"convert\", 0, Some(100), None);\n    let started = std::time::Instant::now();\n    let wav = to_wav16k(&input).await?;\n    let out_prefix = super::temp_dir().join(format!(\"whisper-{}\", uuid::Uuid::new_v4()));\n\n    let mut cmd = crate::core::process::command(&bin);\n    cmd.arg(\"-m\").arg(&model_path).arg(\"-f\").arg(&wav);\n    cmd.args([\"-oj\", \"-pp\", \"-np\", \"-of\"]).arg(&out_prefix);\n    let lang = if opts.language.trim().is_empty() {\n        \"auto\"\n    } else {\n        opts.language.trim()","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/whisper.rs#L306-L342","documentation":"transcribe() builds the model path as models_dir/ggml-<model>.bin and checks existence before running. If the selected GGML model was never downloaded, this error is returned. Model ids must match the MODELS table (e.g. \"large-v3-turbo-q5_0\"); the file must have been fetched via download_model().","triggerScenarios":"Calling transcribe with opts.model set to an id whose ggml-<model>.bin is absent from the models directory — never downloaded, deleted via remove_model, or a typo in the id that doesn't match any downloaded file.","commonSituations":"User cleared app data (removing models) then tried to transcribe; passing a raw model name like \"large-v3\" from another tool's naming when the app uses quantized ids like \"large-v3-q5_0\"; a download_model call that failed partway leaving no/partial file (partial files also fail here because existence uses the exact name).","solutions":["Call whisper::download_model(opts.model, progress) first, then transcribe.","Check availability with whisper::list_models() (installed/size_bytes per model) or status().models.","Make sure opts.model matches an id in the MODELS table exactly (e.g. \"tiny-q5_1\", not \"tiny\").","Re-download if a previous download failed or the file was removed."],"exampleFix":"// before\nwhisper::transcribe(opts, progress).await?;\n\n// after\nlet installed = whisper::list_models().iter().any(|m| m.installed && m.id == opts.model);\nif !installed {\n    whisper::download_model(&opts.model, progress.clone()).await?;\n}\nwhisper::transcribe(opts, progress).await?;","handlingStrategy":"validation","validationCode":"let have_model = whisper::list_models()\n    .iter()\n    .any(|m| m.id == opts.model && m.installed);\nif !have_model {\n    whisper::download_model(&opts.model, progress.clone()).await?;\n}","typeGuard":null,"tryCatchPattern":"match whisper::transcribe(opts.clone(), progress.clone()).await {\n    Err(e) if e.to_string().contains(\"nao esta baixado\") => {\n        whisper::download_model(&opts.model, progress).await?;\n        // then retry transcribe\n    }\n    other => other?,\n}","preventionTips":["Use ids exactly from the MODELS table (e.g. \"large-v3-turbo-q5_0\").","Download models via download_model before transcribing.","Avoid clearing app data without re-downloading models."],"tags":["file-not-found","model","whisper-cpp","precondition"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}