{"record":{"id":"5e0563a88c6ed4ed","repo":"sgl-project/sglang","slug":"model-config-does-not-contain-a-class-name-attrib-5e0563","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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/diffusion_decoder_loader.py","lineNumber":38,"sourceCode":"    \"\"\"Loader for the standalone, replicated LTX-2.5 diffusion decoder.\"\"\"\n\n    component_names = [\"diffusion_decoder\"]\n    expected_library = \"diffusers\"\n\n    def load_customized(\n        self,\n        component_model_path: str,\n        server_args: ServerArgs,\n        component_name: str = \"diffusion_decoder\",\n        *args,\n    ):\n        config = self.load_component_config(component_model_path, component_name)\n        component_weights_path = self.resolve_component_weights_path(\n            component_model_path, server_args, component_name\n        )\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        config.pop(\"_diffusers_version\", None)\n        config.pop(\"_name_or_path\", None)\n\n        server_args.model_paths[component_name] = component_model_path\n        model_cls, _ = ModelRegistry.resolve_model_cls(class_name)\n        target_device = self.target_device(\n            server_args.should_start_component_on_cpu(component_name)\n        )\n        dtype = resolve_precision(\n            server_args, component_name, precision_attr=\"vae_precision\"\n        )\n\n        decoder_config = LTX25DiffusionDecoderConfig()\n        decoder_config.update_model_arch(config)\n        with set_default_torch_dtype(dtype), skip_init_modules():","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/diffusion_decoder_loader.py#L20-L56","documentation":"The diffusion decoder loader instantiates the decoder class from config's '_class_name'. If that key is missing (None after pop), it raises this ValueError — only diffusers-format component configs, which carry _class_name, are supported.","triggerScenarios":"Loading a diffusion decoder component directory whose config.json lacks '_class_name' (transformers-style config, hand-written config, or wrong directory).","commonSituations":"Wrong subdirectory given as the decoder path; decoder exported without diffusers save_pretrained; a renamed/mangled config.json.","solutions":["Point the decoder component path at the diffusers-format directory containing config.json with _class_name","Re-export the decoder with diffusers save_pretrained","Manually add \"_class_name\": \"<DecoderClass>\" if the config is otherwise correct"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json\n\ncfg = json.load(open(f\"{decoder_path}/config.json\"))\nassert cfg.get(\"_class_name\"), \"decoder component must be diffusers-format\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export decoder components with diffusers save_pretrained","Smoke-test component configs before server launch"],"tags":["model-loading","diffusers","decoder","config"],"backgroundTag":"missing-config-key","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}