{"record":{"id":"87045a63a92324be","repo":"babysor/MockingBird","slug":"model-folder-voc-models-dirt-doesn-t-exist","errorCode":null,"errorMessage":"Model folder {VOC_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":46,"sourceCode":"    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    )\n    local_audio_file: audio_input_selection = Field(\n        ..., alias=\"选择语音（本地wav）\",\n        description=\"选择本地语音文件.\"\n    )\n    record_audio_file: FileContent = Field(default=None, alias=\"录制语音\",\n        description=\"录音.\", is_recorder=True, mime_type=\"audio/wav\")\n    upload_audio_file: FileContent = Field(default=None, alias=\"或上传语音\",\n        description=\"拖拽或点击上传.\", mime_type=\"audio/wav\")\n    encoder: encoders = Field(\n        ..., alias=\"编码模型\", \n        description=\"选择语音编码模型文件.\"\n    )","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/app.py#L28-L64","documentation":"Startup guard in mkgui/app.py for the vocoder models directory (VOC_MODELS_DIRT). The app globs '**/*gan*.pt' to list vocoders (HiFi-GAN etc.) for its dropdown; if the folder is absent the module raises at import time. Note the neighboring code prints the wrong variable (synthesizers) but the raise itself is about vocoders.","triggerScenarios":"Launching the mkgui app when the vocoder models folder does not exist.","commonSituations":"HiFi-GAN vocoder weights not downloaded; folder moved or renamed; fresh setup without pretrained assets.","solutions":["Create the vocoder models directory and place a *gan*.pt checkpoint in it (e.g. hifigan.pt)","Download the pretrained vocoder weights from the project release and extract to the expected path","Check VOC_MODELS_DIRT in the config points to the actual vocoder checkpoint location"],"exampleFix":"# before: vocoder/saved_models missing\nmkdir -p vocoder/saved_models\ncp hifigan_v1.pt vocoder/saved_models/\n# after: app import succeeds, vocoders dropdown populated","handlingStrategy":"validation","validationCode":"voc_dir = Path(VOC_MODELS_DIRT)\nif not voc_dir.is_dir() or not list(voc_dir.glob('**/*gan*.pt')):\n    raise SystemExit(f'Vocoder (*gan*.pt) missing in {voc_dir}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate model dirs in a health-check endpoint before serving the GUI","Automate pretrained model download at deploy time","Name vocoder checkpoints with 'gan' in the filename so the glob matches"],"tags":["python","models","filesystem","mkgui","startup","vocoder"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}