babysor/MockingBird · critical · Exception

Model folder {ENC_MODELS_DIRT} doesn't exist.

Error message

Model folder {ENC_MODELS_DIRT} doesn't exist.

What it means

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.

Source

Thrown at control/mkgui/preprocess.py:23

from typing import Any, Tuple


# Constants
EXT_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}ppg_extractor"
ENC_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}encoder"


if os.path.isdir(EXT_MODELS_DIRT):    
    extractors =  Enum('extractors', list((file.name, file) for file in Path(EXT_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded extractor models: " + str(len(extractors)))
else:
    raise Exception(f"Model folder {EXT_MODELS_DIRT} doesn't exist.")

if os.path.isdir(ENC_MODELS_DIRT):    
    encoders = Enum('encoders', list((file.name, file) for file in Path(ENC_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded encoders models: " + str(len(encoders)))
else:
    raise Exception(f"Model folder {ENC_MODELS_DIRT} doesn't exist.")

class Model(str, Enum):
    VC_PPG2MEL = "ppg2mel"

class Dataset(str, Enum):
    AIDATATANG_200ZH = "aidatatang_200zh"
    AIDATATANG_200ZH_S = "aidatatang_200zh_s"

class Input(BaseModel):
    # def render_input_ui(st, input) -> Dict: 
    #     input["selected_dataset"] = st.selectbox(
    #         '选择数据集', 
    #         ("aidatatang_200zh", "aidatatang_200zh_s")
    #     )
    # return input
    model: Model = Field(
        Model.VC_PPG2MEL, title="目标模型",
    )

View on GitHub (pinned to 28dc5e14f1)

Solutions

  1. Create the encoder models directory and copy the encoder .pt checkpoint in
  2. Download the pretrained models bundle to the expected location
  3. Verify ENC_MODELS_DIRT in config

Example fix

# before: encoder/saved_models missing
mkdir -p encoder/saved_models && cp encoder.pt encoder/saved_models/
# after: 'Loaded encoders models: 1', page loads
Defensive patterns

Strategy: validation

Validate before calling

enc_dir = Path(ENC_MODELS_DIRT)
if not enc_dir.is_dir() or not list(enc_dir.glob('*.pt')):
    raise SystemExit(f'Encoder models missing in {enc_dir}')

Prevention

When it happens

Trigger: Loading the preprocessing page with no encoder models directory at the configured path.

Common situations: Pretrained encoder not downloaded; models stored under a renamed directory; fresh environment.

Related errors


AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27). Data as JSON: /api/errors/54f2edf328a8d264. Report an issue: GitHub.