{"record":{"id":"a71ba71b875dcb44","repo":"babysor/MockingBird","slug":"model-folder-enc-models-dirt-doesn-t-exist","errorCode":null,"errorMessage":"Model folder {ENC_MODELS_DIRT} doesn't exist.","messagePattern":"Model folder (.+?) doesn't exist\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"control/mkgui/app.py","lineNumber":40,"sourceCode":"TEMP_RESULT_AUDIO = f\"wavs{os.sep}temp_result.wav\"\nif not os.path.isdir(\"wavs\"):\n    os.makedirs(\"wavs\")\n\n# Load local sample audio as options TODO: load dataset \nif os.path.isdir(AUDIO_SAMPLES_DIR):\n    audio_input_selection = Enum('samples', list((file.name, file) for file in Path(AUDIO_SAMPLES_DIR).glob(\"*.wav\")))\n# Pre-Load models\nif os.path.isdir(SYN_MODELS_DIRT):    \n    synthesizers =  Enum('synthesizers', list((file.name, file) for file in Path(SYN_MODELS_DIRT).glob(\"**/*.pt\")))\n    print(\"Loaded synthesizer models: \" + str(len(synthesizers)))\nelse:\n    raise Exception(f\"Model folder {SYN_MODELS_DIRT} doesn't exist. 请将模型文件位置移动到上述位置中进行重试！\")\n\nif os.path.isdir(ENC_MODELS_DIRT):    \n    encoders =  Enum('encoders', list((file.name, file) for file in Path(ENC_MODELS_DIRT).glob(\"**/*.pt\")))\n    print(\"Loaded encoders models: \" + str(len(encoders)))\nelse:\n    raise Exception(f\"Model folder {ENC_MODELS_DIRT} doesn't exist.\")\n\nif os.path.isdir(VOC_MODELS_DIRT):    \n    vocoders =  Enum('vocoders', list((file.name, file) for file in Path(VOC_MODELS_DIRT).glob(\"**/*gan*.pt\")))\n    print(\"Loaded vocoders models: \" + str(len(synthesizers)))\nelse:\n    raise Exception(f\"Model folder {VOC_MODELS_DIRT} doesn't exist.\")\n\n\nclass Input(BaseModel):\n    message: str = Field(\n        ..., example=\"欢迎使用工具箱, 现已支持中文输入！\", alias=\"文本内容\"\n    )\n    local_audio_file: audio_input_selection = Field(\n        ..., alias=\"选择语音（本地wav）\",\n        description=\"选择本地语音文件.\"\n    )\n    record_audio_file: FileContent = Field(default=None, alias=\"录制语音\",\n        description=\"录音.\", is_recorder=True, mime_type=\"audio/wav\")","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/app.py#L22-L58","documentation":"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.","triggerScenarios":"Launching the mkgui app when the encoder models folder does not exist or contains no checkpoint files at the expected path.","commonSituations":"Pretrained encoder weights not downloaded yet; models saved under a different root; fresh clone without pretrained assets.","solutions":["Create the encoder models directory and copy the pretrained encoder .pt into it","Download the released pretrained models package and extract it at the expected path","Verify/adjust ENC_MODELS_DIRT in config so it matches where your encoder checkpoints live"],"exampleFix":"# before: encoder/saved_models/ missing\nmkdir -p encoder/saved_models\ncp pretrained/encoder.pt encoder/saved_models/\n# after: app import succeeds","handlingStrategy":"validation","validationCode":"enc_dir = Path(ENC_MODELS_DIRT)\nif not enc_dir.is_dir() or not list(enc_dir.glob('*.pt')):\n    raise SystemExit(f'Encoder models missing in {enc_dir}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Preflight-check all model directories before app startup","Download pretrained bundle in the Dockerfile/provision script","Fail with the exact expected path so users know where to put files"],"tags":["python","models","filesystem","mkgui","startup"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}