{"record":{"id":"f95869929cbbf0f4","repo":"SubtitleEdit/subtitleedit","slug":"model-folder-not-found-sourcedir","errorCode":null,"errorMessage":"Model folder not found: {sourceDir}","messagePattern":"Model folder not found: (.+?)","errorType":"exception","errorClass":"DirectoryNotFoundException","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/SpeechToText/Engines/WhisperEnginePurfviewFasterWhisperXxl.cs","lineNumber":156,"sourceCode":"\n    public bool CustomModelIsFolder => true;\n\n    public string ImportCustomModel(string sourcePath)\n    {\n        return ImportFasterWhisperFolderModel(sourcePath, GetAndCreateWhisperModelFolder(null));\n    }\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);","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/SpeechToText/Engines/WhisperEnginePurfviewFasterWhisperXxl.cs#L138-L174","documentation":"Thrown by ImportFasterWhisperFolderModel when the source directory path does not exist (Directory.Exists returns false). Faster-whisper models are imported as folders (not single files), so this is the first check before looking for model.bin inside. The modelsFolder parameter is the destination _models folder, not the source.","triggerScenarios":"The user selects a folder path that was deleted, moved, or never existed; the path is actually a file, not a directory; the path is on a disconnected network share or removable drive; the path was typed manually with a typo.","commonSituations":"User typed a path instead of using the folder browser dialog; the folder was moved after selection; the path points to a .zip archive that hasn't been extracted yet (faster-whisper models are distributed as folders, sometimes zipped); network drive disconnected.","solutions":["Use the folder picker dialog to select the model folder.","If the model was downloaded as a .zip, extract it first and select the extracted folder.","Verify the folder exists and contains the expected model files (model.bin at minimum).","Check for typos in manually-entered paths.","Ensure removable/network drives are connected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!Directory.Exists(sourceDir))\n    throw new DirectoryNotFoundException($\"Select a valid faster-whisper model folder. '{sourceDir}' does not exist or is not a directory.\");","typeGuard":"static bool IsValidFasterWhisperFolder(string dir) =>\n    Directory.Exists(dir) &&\n    File.Exists(Path.Combine(dir, \"model.bin\"));","tryCatchPattern":"try { var name = WhisperEnginePurfviewFasterWhisperXxl.ImportFasterWhisperFolderModel(sourceDir, modelsFolder); }\ncatch (DirectoryNotFoundException ex)\n{ /* re-prompt with folder picker, verify path */ }","preventionTips":["Use a folder picker dialog for model folder selection.","Extract any downloaded .zip archives before selecting the folder.","Verify the folder path exists in the file manager before importing."],"tags":["io","directory-not-found","whisper","model","validation"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}