{"record":{"id":"959ed850093036cb","repo":"sgl-project/sglang","slug":"invalid-projection-layers-config-projection-laye","errorCode":null,"errorMessage":"Invalid projection layers: {config.projection_layers}","messagePattern":"Invalid projection layers: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/models/mimo_audio.py","lineNumber":1256,"sourceCode":"                )\n                for i in range(self.audio_channels)\n            ]\n        )\n\n        if config.projection_layers == 1:\n            self.projection = nn.Linear(\n                self.audio_input_local_dim * self.audio_group_size,\n                self.audio_out_hidden_size,\n                bias=False,\n            )\n        elif config.projection_layers == 2:\n            self.projection = AudioProjection(\n                self.audio_input_local_dim * self.audio_group_size,\n                self.audio_input_local_dim * self.audio_group_size * 4,\n                self.audio_out_hidden_size,\n            )\n        else:\n            raise ValueError(f\"Invalid projection layers: {config.projection_layers}\")\n\n        model_path = get_model().model_path\n        if not os.path.isdir(model_path):\n            from huggingface_hub import snapshot_download\n\n            model_path = snapshot_download(\n                model_path,\n                allow_patterns=[\"audio_tokenizer/*\"],\n            )\n        audio_tokenizer_path = os.path.join(model_path, \"audio_tokenizer\")\n        dev = torch.device(f\"cuda:{torch.cuda.current_device()}\")\n        self.audio_tokenizer = self._load_mimo_audio_tokenizer(\n            audio_tokenizer_path, dev\n        )\n\n    @staticmethod\n    def _load_mimo_audio_tokenizer(\n        path: str, device: torch.device","sourceCodeStart":1238,"sourceCodeEnd":1274,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/mimo_audio.py#L1238-L1274","documentation":"MiMo audio encoder construction switches on config.projection_layers to choose the projection head architecture; values outside the supported set fall through to this error. It indicates the config was authored for an unsupported or newer projection layout than this code supports.","triggerScenarios":"config.projection_layers is an unrecognized value (e.g. an int or string not in the handled branches) when the audio model is constructed during engine init. Typically triggered by a mismatched audio config.json for the MiMo checkpoint.","commonSituations":"Mixing audio tokenizer weights/config from a different MiMo release; upgrading sglang against an older audio config; hand-edited projection config.","solutions":["Check the supported projection_layers values in mimo_audio.py build_audio_encoder and set config.projection_layers accordingly","Re-download the audio tokenizer assets matching your sglang version (snapshot_download of the correct repo)","Pin sglang and the MiMo checkpoint to a compatible release pair"],"exampleFix":"// before\n\"projection_layers\": \"v3\"\n// after\n\"projection_layers\": 2  // a value handled by build_audio_encoder","handlingStrategy":"validation","validationCode":"from sglang.srt.models.mimo_audio import build_audio_encoder  # inspect supported values\n# before launch, confirm config value is one handled in build_audio_encoder:\n# print the branch conditions or check release notes for your sglang version","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep audio tokenizer assets and sglang version in lockstep","Test-launch the audio model after upgrading either side"],"tags":["mimo-audio","config-validation","audio-encoder","version-mismatch"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}