{"record":{"id":"c70ca8b3a978131d","repo":"babysor/MockingBird","slug":"model-folder-enc-models-dirt-doesn-t-exist-c70ca8","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/train.py","lineNumber":29,"sourceCode":"ENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\n\n\n# EXT_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}ppg_extractor\"\n# CONV_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}ppg2mel\"\n# ENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\n\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\nclass Model(str, Enum):\n    DEFAULT = \"default\"\n\nclass Input(BaseModel):\n    model: Model = Field(\n        Model.DEFAULT, title=\"模型类型\",\n    )\n    # datasets_root: str = Field(\n    #     ..., alias=\"预处理数据根目录\", description=\"输入目录（相对/绝对）,不适用于ppg2mel模型\",\n    #     format=True,\n    #     example=\"..\\\\trainning_data\\\\\"\n    # )\n    input_root: str = Field(\n        ..., alias=\"输入目录\", description=\"预处理数据根目录\",\n        format=True,\n        example=f\"..{os.sep}audiodata{os.sep}SV2TTS{os.sep}synthesizer\"\n    )","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/train.py#L11-L47","documentation":"Import-time guard in mkgui/train.py for the encoder models directory (ENC_MODELS_DIRT). The training page needs encoder checkpoints listed for its dropdown; absent folder raises at import.","triggerScenarios":"Loading the mkgui training page with no encoder models directory.","commonSituations":"Pretrained encoder weights not present; wrong models root in config; first run after clone.","solutions":["Create the encoder models directory and place the encoder .pt checkpoint in it","Download pretrained models to the expected location","Check ENC_MODELS_DIRT configuration"],"exampleFix":"# before: encoder/saved_models missing\nmkdir -p encoder/saved_models && cp encoder.pt encoder/saved_models/\n# after: 'Loaded encoders models: 1', training page loads","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 model directories before launching training UI","Bundle pretrained encoder weights","Centralize model path config"],"tags":["python","models","filesystem","mkgui","training"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}