SubtitleEdit/subtitleedit · error · DirectoryNotFoundException

Model folder not found: {sourceDir}

Error message

Model folder not found: {sourceDir}

What it means

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.

Source

Thrown at src/ui/Features/Video/SpeechToText/Engines/WhisperEnginePurfviewFasterWhisperXxl.cs:156

    public bool CustomModelIsFolder => true;

    public string ImportCustomModel(string sourcePath)
    {
        return ImportFasterWhisperFolderModel(sourcePath, GetAndCreateWhisperModelFolder(null));
    }

    /// <summary>
    /// Validates and copies a faster-whisper model folder (containing model.bin) into the
    /// shared "_models" folder. The destination is normalized to "faster-whisper-&lt;name&gt;" so
    /// both this engine and the CTranslate2 engine (which builds its --model path as
    /// "_models/faster-whisper-&lt;name&gt;") resolve it. Returns the display name (without prefix).
    /// </summary>
    internal static string ImportFasterWhisperFolderModel(string sourceDir, string modelsFolder)
    {
        if (!Directory.Exists(sourceDir))
        {
            throw new DirectoryNotFoundException("Model folder not found: " + sourceDir);
        }

        var modelBin = Path.Combine(sourceDir, "model.bin");
        if (!File.Exists(modelBin))
        {
            throw new Exception("A faster-whisper model folder must contain a 'model.bin' file.");
        }

        if (new FileInfo(modelBin).Length < 10_000_000)
        {
            throw new Exception("The 'model.bin' file is too small (must be at least 10 MB) - is it really a faster-whisper model?");
        }

        var sourceName = Path.GetFileName(sourceDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
        var baseName = sourceName;
        if (baseName.StartsWith("faster-whisper-", StringComparison.OrdinalIgnoreCase))
        {
            baseName = baseName.Substring("faster-whisper-".Length);

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Use the folder picker dialog to select the model folder.
  2. If the model was downloaded as a .zip, extract it first and select the extracted folder.
  3. Verify the folder exists and contains the expected model files (model.bin at minimum).
  4. Check for typos in manually-entered paths.
  5. Ensure removable/network drives are connected.
Defensive patterns

Strategy: validation

Validate before calling

if (!Directory.Exists(sourceDir))
    throw new DirectoryNotFoundException($"Select a valid faster-whisper model folder. '{sourceDir}' does not exist or is not a directory.");

Type guard

static bool IsValidFasterWhisperFolder(string dir) =>
    Directory.Exists(dir) &&
    File.Exists(Path.Combine(dir, "model.bin"));

Try / catch

try { var name = WhisperEnginePurfviewFasterWhisperXxl.ImportFasterWhisperFolderModel(sourceDir, modelsFolder); }
catch (DirectoryNotFoundException ex)
{ /* re-prompt with folder picker, verify path */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/f95869929cbbf0f4. Report an issue: GitHub.