{"record":{"id":"a8fda94666f26a1d","repo":"babysor/MockingBird","slug":"model-folder-enc-models-dirt-doesn-t-exist-a8fda9","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_vc.py","lineNumber":33,"sourceCode":"\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(CONV_MODELS_DIRT):    \n    convertors =  Enum('convertors', list((file.name, file) for file in Path(CONV_MODELS_DIRT).glob(\"**/*.pth\")))\n    print(\"Loaded convertor models: \" + str(len(convertors)))\nelse:\n    raise Exception(f\"Model folder {CONV_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":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/train_vc.py#L15-L51","documentation":"Import-time guard in mkgui/train_vc.py for the encoder models directory (ENC_MODELS_DIRT); the VC training page lists encoder .pt checkpoints at import time and raises if the folder is missing.","triggerScenarios":"Loading the VC training page with no encoder models directory.","commonSituations":"Pretrained encoder not installed; models directory moved; fresh setup.","solutions":["Create the encoder models directory and place the encoder .pt checkpoint in it","Download pretrained encoder weights 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', VC 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 encoder model dir before VC training UI","Download pretrained encoder in setup","Fail fast with expected path in message"],"tags":["python","models","filesystem","mkgui","voice-conversion","training"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}