{"record":{"id":"3feb2806bacce7d8","repo":"sgl-project/sglang","slug":"model-directory-model-path-is-missing-required-c","errorCode":null,"errorMessage":"Model directory {model_path} is missing required component directories: {missing_str}.","messagePattern":"Model directory (.+?) is missing required component directories: (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py","lineNumber":730,"sourceCode":"\n    logger.info(\"Diffusers version: %s\", config[\"_diffusers_version\"])\n\n    component_keys = [\n        key\n        for key, value in config.items()\n        if isinstance(value, (list, tuple))\n        and len(value) == 2\n        and all(isinstance(item, str) for item in value)\n    ]\n    if component_keys:\n        missing_components = [\n            component_key\n            for component_key in component_keys\n            if not os.path.exists(os.path.join(model_path, component_key))\n        ]\n        if missing_components:\n            missing_str = \", \".join(missing_components)\n            raise ValueError(\n                f\"Model directory {model_path} is missing required component \"\n                f\"directories: {missing_str}.\"\n            )\n    else:\n        transformer_dir = os.path.join(model_path, \"transformer\")\n        vae_dir = os.path.join(model_path, \"vae\")\n        if not os.path.exists(transformer_dir):\n            raise ValueError(\n                f\"Model directory {model_path} does not contain a transformer/ directory.\"\n            )\n        if not os.path.exists(vae_dir):\n            raise ValueError(\n                f\"Model directory {model_path} does not contain a vae/ directory.\"\n            )\n    return cast(dict[str, Any], config)\n\n\ndef _resolve_remote_repo_model_index_path(model_name_or_path: str) -> str:","sourceCodeStart":712,"sourceCodeEnd":748,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/hf_diffusers_utils.py#L712-L748","documentation":"Each component key in model_index.json must correspond to a subdirectory of the model path. verify_model_config_and_directory collects keys with nested config (non-string values) and raises ValueError listing any subdirectories that are missing.","triggerScenarios":"Calling from_pretrained on a partially downloaded model: model_index.json lists transformer/, vae/, text_encoder/ etc., but some of those directories are absent from the local snapshot.","commonSituations":"Interrupted downloads; manually deleting component folders to save disk; wrong-revision mixups where components live at a different revision.","solutions":["Delete the incomplete local model directory and re-download fully","If intentionally excluding a component (e.g. offloaded text encoder), remove its key from model_index.json or use the loader's component-override mechanism instead of deleting folders"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json, os\nidx = json.load(open(f'{model_path}/model_index.json'))\ncomps = [k for k, v in idx.items() if isinstance(v, (list, tuple))]\nmissing = [c for c in comps if not os.path.isdir(os.path.join(model_path, c))]\nassert not missing, missing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Download full snapshots, not selected folders","Run a completeness check against model_index.json after downloads"],"tags":["diffusers","incomplete-download","model-files"],"backgroundTag":"model-files-missing","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}