{"record":{"id":"4425c0619efc66d8","repo":"babysor/MockingBird","slug":"model-folder-ext-models-dirt-doesn-t-exist-4425c0","errorCode":null,"errorMessage":"Model folder {EXT_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":17,"sourceCode":"from pydantic import BaseModel, Field\nimport os\nfrom pathlib import Path\nfrom enum import Enum\nfrom 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    #         '选择数据集', ","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/preprocess.py#L1-L35","documentation":"Import-time guard in mkgui/preprocess.py: the preprocessing page requires an extractor models directory (EXT_MODELS_DIRT) containing .pt files to build its extractors dropdown; absence raises immediately when the module loads.","triggerScenarios":"Opening the mkgui preprocessing page (or importing preprocess.py) with no extractor models directory present.","commonSituations":"Running preprocessing before any extractor model was trained/downloaded; misconfigured models root path.","solutions":["Create the extractor models directory and add an extractor .pt checkpoint","Download pretrained extractor weights to the expected path","Check EXT_MODELS_DIRT configuration"],"exampleFix":"# before: extractor/saved_models missing\nmkdir -p extractor/saved_models && cp extractor.pt extractor/saved_models/\n# after: module imports, 'Loaded extractor models: 1'","handlingStrategy":"validation","validationCode":"ext_dir = Path(EXT_MODELS_DIRT)\nif not ext_dir.is_dir() or not list(ext_dir.glob('**/*.pt')):\n    raise SystemExit(f'Extractor models missing in {ext_dir}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check model directories before importing mkgui pages","Provision pretrained extractor in setup scripts","Log expected vs actual model paths at startup"],"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"}