{"record":{"id":"87bdce897083bc6f","repo":"babysor/MockingBird","slug":"model-folder-syn-models-dirt-doesn-t-exist","errorCode":null,"errorMessage":"Model folder {SYN_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":34,"sourceCode":"# Constants\nAUDIO_SAMPLES_DIR = f\"data{os.sep}samples{os.sep}\"\nSYN_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}synthesizer\"\nENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\nVOC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}vocoder\"\nTEMP_SOURCE_AUDIO = f\"wavs{os.sep}temp_source.wav\"\nTEMP_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    )","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/app.py#L16-L52","documentation":"Raised at import time of the mkgui app when the synthesizer models directory (SYN_MODELS_DIRT, typically encoder/saved_models/...) does not exist. The GUI pre-enumerates available .pt models to build Enum dropdowns; with no folder there is nothing to select, so it aborts startup. The Chinese message tells the user to move model files to the expected location.","triggerScenarios":"Starting the mkgui web app before any synthesizer model has been trained or downloaded into the expected models directory; or the directory constant points to a wrong/moved path.","commonSituations":"First-time users who haven't downloaded pretrained models; custom HP save paths; renaming/relocating the models folder after training.","solutions":["Create the expected synthesizer models directory and place at least one .pt checkpoint in it (or a subdirectory)","Train or download a pretrained synthesizer model so the folder is populated","Check the SYN_MODELS_DIRT constant / config to make sure it points to the real location of your models"],"exampleFix":"# before: encoder/saved_models/synthesizer missing\nmkdir -p encoder/saved_models/synthesizer\ncp my_synthesizer.pt encoder/saved_models/synthesizer/\n# after: app starts and prints 'Loaded synthesizer models: 1'","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nsyn_dir = Path(SYN_MODELS_DIRT)\nif not syn_dir.is_dir() or not list(syn_dir.glob('**/*.pt')):\n    raise SystemExit(f'No synthesizer models in {syn_dir}; download/place .pt checkpoints first')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run a preflight script that verifies every expected models directory before launching the GUI","Keep a single configured models root and document its layout","Ship/download pretrained checkpoints as part of deployment"],"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"}