{"record":{"id":"fd4c1a5b31f445a8","repo":"SubtitleEdit/subtitleedit","slug":"a-faster-whisper-model-folder-must-contain-a-mode","errorCode":null,"errorMessage":"A faster-whisper model folder must contain a 'model.bin' file.","messagePattern":"A faster-whisper model folder must contain a 'model\\.bin' file\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/SpeechToText/Engines/WhisperEnginePurfviewFasterWhisperXxl.cs","lineNumber":162,"sourceCode":"    }\n\n    /// <summary>\n    /// Validates and copies a faster-whisper model folder (containing model.bin) into the\n    /// shared \"_models\" folder. The destination is normalized to \"faster-whisper-&lt;name&gt;\" so\n    /// both this engine and the CTranslate2 engine (which builds its --model path as\n    /// \"_models/faster-whisper-&lt;name&gt;\") resolve it. Returns the display name (without prefix).\n    /// </summary>\n    internal static string ImportFasterWhisperFolderModel(string sourceDir, string modelsFolder)\n    {\n        if (!Directory.Exists(sourceDir))\n        {\n            throw new DirectoryNotFoundException(\"Model folder not found: \" + sourceDir);\n        }\n\n        var modelBin = Path.Combine(sourceDir, \"model.bin\");\n        if (!File.Exists(modelBin))\n        {\n            throw new Exception(\"A faster-whisper model folder must contain a 'model.bin' file.\");\n        }\n\n        if (new FileInfo(modelBin).Length < 10_000_000)\n        {\n            throw new Exception(\"The 'model.bin' file is too small (must be at least 10 MB) - is it really a faster-whisper model?\");\n        }\n\n        var sourceName = Path.GetFileName(sourceDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));\n        var baseName = sourceName;\n        if (baseName.StartsWith(\"faster-whisper-\", StringComparison.OrdinalIgnoreCase))\n        {\n            baseName = baseName.Substring(\"faster-whisper-\".Length);\n        }\n\n        var destFolder = Path.Combine(modelsFolder, \"faster-whisper-\" + baseName);\n        CopyDirectory(sourceDir, destFolder);\n\n        return baseName;","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/SpeechToText/Engines/WhisperEnginePurfviewFasterWhisperXxl.cs#L144-L180","documentation":"Thrown by ImportFasterWhisperFolderModel when the source directory exists but does not contain a 'model.bin' file. A valid faster-whisper (CTranslate2) model folder must contain model.bin as its core weight file. Without it, the folder is not a usable faster-whisper model regardless of its other contents.","triggerScenarios":"The selected folder is a partial download missing model.bin; the folder is a configuration directory from another engine (e.g. WhisperEngineCpp's .bin files, or a Hugging Face repo that hasn't finished downloading); the user selected a parent folder when model.bin is in a subfolder.","commonSituations":"The model download (e.g. from Hugging Face) was interrupted before model.bin was fetched (it's usually the largest file); the user selected the wrong folder level — model.bin is one directory deeper; the folder is from a different whisper engine format; a git clone without LFS pulled only metadata files.","solutions":["Open the selected folder in a file manager and verify model.bin is present.","If downloading from Hugging Face, ensure the download completed (model.bin is typically 100+ MB to GBs).","If using git clone, run 'git lfs install && git lfs pull' to fetch model.bin.","Navigate into the correct subfolder — some models nest model.bin inside a 'ctranslate2' or model-name subdirectory.","Re-download the complete model folder from the source repository."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var modelBinPath = Path.Combine(sourceDir, \"model.bin\");\nif (!File.Exists(modelBinPath))\n    throw new FileNotFoundException($\"The selected folder does not contain 'model.bin'. Faster-whisper models must include this file.\", modelBinPath);","typeGuard":"static bool HasModelBin(string dir) =>\n    Directory.Exists(dir) && File.Exists(Path.Combine(dir, \"model.bin\"));","tryCatchPattern":"try { var name = WhisperEnginePurfviewFasterWhisperXxl.ImportFasterWhisperFolderModel(sourceDir, modelsFolder); }\ncatch (Exception ex) when (ex.Message.Contains(\"model.bin\"))\n{ /* advise: extract zip fully, check subfolder level, run git lfs pull */ }","preventionTips":["Verify model.bin exists in the selected folder before importing.","If downloading from Hugging Face, ensure the download completed (model.bin is the largest file).","Check that you selected the correct folder level — model.bin may be in a subfolder.","Run 'git lfs pull' if the model was cloned from a git repository."],"tags":["validation","whisper","model","missing-file","faster-whisper"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}