{"record":{"id":"54f2edf328a8d264","repo":"babysor/MockingBird","slug":"model-folder-enc-models-dirt-doesn-t-exist-54f2ed","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/preprocess.py","lineNumber":23,"sourceCode":"from typing import Any, Tuple\n\n\n# Constants\nEXT_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}ppg_extractor\"\nENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\n\n\nif os.path.isdir(EXT_MODELS_DIRT):    \n    extractors =  Enum('extractors', list((file.name, file) for file in Path(EXT_MODELS_DIRT).glob(\"**/*.pt\")))\n    print(\"Loaded extractor models: \" + str(len(extractors)))\nelse:\n    raise Exception(f\"Model folder {EXT_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    VC_PPG2MEL = \"ppg2mel\"\n\nclass Dataset(str, Enum):\n    AIDATATANG_200ZH = \"aidatatang_200zh\"\n    AIDATATANG_200ZH_S = \"aidatatang_200zh_s\"\n\nclass Input(BaseModel):\n    # def render_input_ui(st, input) -> Dict: \n    #     input[\"selected_dataset\"] = st.selectbox(\n    #         '选择数据集', \n    #         (\"aidatatang_200zh\", \"aidatatang_200zh_s\")\n    #     )\n    # return input\n    model: Model = Field(\n        Model.VC_PPG2MEL, title=\"目标模型\",\n    )","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/preprocess.py#L5-L41","documentation":"Import-time guard in mkgui/preprocess.py for the encoder models directory (ENC_MODELS_DIRT); the page builds an encoders Enum from *.pt files there. Missing folder raises at import.","triggerScenarios":"Loading the preprocessing page with no encoder models directory at the configured path.","commonSituations":"Pretrained encoder not downloaded; models stored under a renamed directory; fresh environment.","solutions":["Create the encoder models directory and copy the encoder .pt checkpoint in","Download the pretrained models bundle to the expected location","Verify ENC_MODELS_DIRT in config"],"exampleFix":"# before: encoder/saved_models missing\nmkdir -p encoder/saved_models && cp encoder.pt encoder/saved_models/\n# after: 'Loaded encoders models: 1', 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 dirs before loading the GUI","Download pretrained encoder during environment setup","Fail fast with the exact expected path"],"tags":["python","models","filesystem","mkgui","preprocessing"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}