{"record":{"id":"95776d35777cfd7e","repo":"SubtitleEdit/subtitleedit","slug":"the-model-file-is-too-small-must-be-at-least-10-m","errorCode":null,"errorMessage":"The model file is too small (must be at least 10 MB) - is it really a whisper.cpp model?","messagePattern":"The model file is too small \\(must be at least 10 MB\\) - is it really a whisper\\.cpp model\\?","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/SpeechToText/Engines/WhisperEngineCpp.cs","lineNumber":151,"sourceCode":"    public bool SupportsCustomModels => true;\n\n    public bool CustomModelIsFolder => false;\n\n    public string ImportCustomModel(string sourcePath)\n    {\n        if (!File.Exists(sourcePath))\n        {\n            throw new FileNotFoundException(\"Model file not found.\", sourcePath);\n        }\n\n        if (!sourcePath.EndsWith(\".bin\", StringComparison.OrdinalIgnoreCase))\n        {\n            throw new Exception(\"A whisper.cpp model must be a ggml '.bin' file.\");\n        }\n\n        if (new FileInfo(sourcePath).Length < 10_000_000)\n        {\n            throw new Exception(\"The model file is too small (must be at least 10 MB) - is it really a whisper.cpp model?\");\n        }\n\n        var destination = Path.Combine(GetAndCreateWhisperModelFolder(null), Path.GetFileName(sourcePath));\n        File.Copy(sourcePath, destination, true);\n\n        return Path.GetFileNameWithoutExtension(destination);\n    }\n\n    public async Task<string> GetHelpText()\n    {\n        var assetName = $\"{StaticName.Replace(\" \", string.Empty)}.txt\";\n        var uri = new Uri($\"avares://SubtitleEdit/Assets/SpeechToText/{assetName}\");\n\n        await using var stream = AssetLoader.Open(uri);\n        using var reader = new StreamReader(stream);\n\n        var contents = await reader.ReadToEndAsync();\n        return contents;","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/SpeechToText/Engines/WhisperEngineCpp.cs#L133-L169","documentation":"Thrown by ImportCustomModel when the .bin file exists and has the correct extension but is smaller than 10 MB. Real whisper.cpp GGML models range from ~39 MB (tiny) to ~3 GB (large). A file under 10 MB is almost certainly not a valid model — it could be a truncated download, a placeholder, or a text file renamed to .bin.","triggerScenarios":"The model download was interrupted and only a partial file was saved; the user selected a small .bin file that is not a whisper model (e.g. a configuration binary, a game asset); the file is a git-LFS pointer instead of the actual model blob.","commonSituations":"Interrupted download left a truncated file; git-LFS pointer file (a few hundred bytes) instead of the actual model because LFS wasn't properly pulled; a corrupted download; the user renamed a non-model file to .bin.","solutions":["Re-download the model file from the official whisper.cpp GitHub releases and ensure the download completes fully.","If using git to obtain the model, run 'git lfs pull' to fetch the actual binary instead of the LFS pointer."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var fileSize = new FileInfo(sourcePath).Length;\nif (fileSize < 10_000_000)\n    throw new InvalidOperationException($\"File is only {fileSize / 1_000_000} MB. whisper.cpp models are at least 39 MB (tiny). The download may be truncated.\");","typeGuard":"static bool IsPlausibleModelSize(string path) =>\n    File.Exists(path) && new FileInfo(path).Length >= 10_000_000;","tryCatchPattern":"try { var name = engine.ImportCustomModel(sourcePath); }\ncatch (Exception ex) when (ex.Message.Contains(\"too small\"))\n{ /* advise re-download, check for git-LFS pointer, verify file integrity */ }","preventionTips":["Verify the downloaded model file size matches the expected size on the download page.","If using git, run 'git lfs pull' to ensure the actual binary was fetched.","Check for interrupted downloads by comparing file size to the server-reported Content-Length."],"tags":["validation","whisper","model","file-size","corrupted-download"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}