{"record":{"id":"7c7b2a9a08fb2d8f","repo":"sgl-project/sglang","slug":"model-config-does-not-contain-a-class-name-attrib-7c7b2a","errorCode":null,"errorMessage":"Model config does not contain a _class_name attribute. Only diffusers format is supported.","messagePattern":"Model config does not contain a _class_name attribute\\. Only diffusers format is supported\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/bridge_loader.py","lineNumber":38,"sourceCode":"logger = init_logger(__name__)\n\n\nclass BridgeLoader(PlainStateDictComponentLoader):\n    \"\"\"Loader for MOVA dual tower bridge with FSDP support.\"\"\"\n\n    pipeline_bridge_config_attr: str = \"bridge_config\"\n\n    component_names = [\"dual_tower_bridge\"]\n    expected_library = \"diffusers\"\n\n    def load_customized(\n        self, component_model_path: str, server_args: ServerArgs, component_name: str\n    ):\n        config = self.load_component_config(component_model_path, component_name)\n        hf_config = deepcopy(config)\n        class_name = config.pop(\"_class_name\", None)\n        if class_name is None:\n            raise ValueError(\n                \"Model config does not contain a _class_name attribute. \"\n                \"Only diffusers format is supported.\"\n            )\n        server_args.model_paths[component_name] = component_model_path\n\n        # Try to get bridge config from pipeline config, fallback to creating one\n        bridge_config = getattr(\n            server_args.pipeline_config, self.pipeline_bridge_config_attr, None\n        )\n        if bridge_config is not None:\n            bridge_config.update_model_arch(config)\n        else:\n            # Create a minimal config from hf_config\n            from sglang.multimodal_gen.configs.models.bridges.mova_dual_tower import (\n                MOVADualTowerConfig,\n            )\n\n            bridge_config = MOVADualTowerConfig()","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/bridge_loader.py#L20-L56","documentation":"The bridge loader requires the component config to be in diffusers format, identified by the '_class_name' key. If popping '_class_name' yields None (key missing), it raises this ValueError since it cannot determine which bridge class to instantiate via ModelRegistry.","triggerScenarios":"Calling bridge loader load_customized on a component directory whose config.json lacks '_class_name' — a transformers-style config or a manually assembled directory.","commonSituations":"Model path pointing at the wrong subdirectory (e.g. the root repo instead of the bridge component folder); a component exported without diffusers; partially downloaded/moved checkpoints missing config.json keys.","solutions":["Point the bridge component path at the directory containing the diffusers-format config.json with _class_name","Re-export or re-download the bridge component in diffusers format","As a last resort for a known-valid config, add \"_class_name\": \"<BridgeClass>\" manually"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json\n\ncfg = json.load(open(f\"{component_path}/config.json\"))\nassert cfg.get(\"_class_name\"), f\"{component_path} is not diffusers-format\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm each component path points at its own config.json with _class_name","Validate the full component tree (config + weights) before server start"],"tags":["model-loading","diffusers","bridge","config"],"backgroundTag":"missing-config-key","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}