babysor/MockingBird · critical · Exception

Model folder {ENC_MODELS_DIRT} doesn't exist.

Error message

Model folder {ENC_MODELS_DIRT} doesn't exist.

What it means

Same startup guard in mkgui/app.py, but for the encoder models directory (ENC_MODELS_DIRT). The app requires the folder to exist so it can build the encoders dropdown from *.pt files inside it. Missing folder aborts import of the app module.

Source

Thrown at control/mkgui/app.py:40

TEMP_RESULT_AUDIO = f"wavs{os.sep}temp_result.wav"
if not os.path.isdir("wavs"):
    os.makedirs("wavs")

# Load local sample audio as options TODO: load dataset 
if os.path.isdir(AUDIO_SAMPLES_DIR):
    audio_input_selection = Enum('samples', list((file.name, file) for file in Path(AUDIO_SAMPLES_DIR).glob("*.wav")))
# Pre-Load models
if os.path.isdir(SYN_MODELS_DIRT):    
    synthesizers =  Enum('synthesizers', list((file.name, file) for file in Path(SYN_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded synthesizer models: " + str(len(synthesizers)))
else:
    raise Exception(f"Model folder {SYN_MODELS_DIRT} doesn't exist. 请将模型文件位置移动到上述位置中进行重试!")

if os.path.isdir(ENC_MODELS_DIRT):    
    encoders =  Enum('encoders', list((file.name, file) for file in Path(ENC_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded encoders models: " + str(len(encoders)))
else:
    raise Exception(f"Model folder {ENC_MODELS_DIRT} doesn't exist.")

if os.path.isdir(VOC_MODELS_DIRT):    
    vocoders =  Enum('vocoders', list((file.name, file) for file in Path(VOC_MODELS_DIRT).glob("**/*gan*.pt")))
    print("Loaded vocoders models: " + str(len(synthesizers)))
else:
    raise Exception(f"Model folder {VOC_MODELS_DIRT} doesn't exist.")


class Input(BaseModel):
    message: str = Field(
        ..., example="欢迎使用工具箱, 现已支持中文输入!", alias="文本内容"
    )
    local_audio_file: audio_input_selection = Field(
        ..., alias="选择语音(本地wav)",
        description="选择本地语音文件."
    )
    record_audio_file: FileContent = Field(default=None, alias="录制语音",
        description="录音.", is_recorder=True, mime_type="audio/wav")

View on GitHub (pinned to 28dc5e14f1)

Solutions

  1. Create the encoder models directory and copy the pretrained encoder .pt into it
  2. Download the released pretrained models package and extract it at the expected path
  3. Verify/adjust ENC_MODELS_DIRT in config so it matches where your encoder checkpoints live

Example fix

# before: encoder/saved_models/ missing
mkdir -p encoder/saved_models
cp pretrained/encoder.pt encoder/saved_models/
# after: app import succeeds
Defensive patterns

Strategy: validation

Validate before calling

enc_dir = Path(ENC_MODELS_DIRT)
if not enc_dir.is_dir() or not list(enc_dir.glob('*.pt')):
    raise SystemExit(f'Encoder models missing in {enc_dir}')

Prevention

When it happens

Trigger: Launching the mkgui app when the encoder models folder does not exist or contains no checkpoint files at the expected path.

Common situations: Pretrained encoder weights not downloaded yet; models saved under a different root; fresh clone without pretrained assets.

Related errors


AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27). Data as JSON: /api/errors/a71ba71b875dcb44. Report an issue: GitHub.