diff --git a/python/sglang/srt/managers/io_struct.py b/python/sglang/srt/managers/io_struct.py index 8875994f1..9343c0a62 100644 --- a/python/sglang/srt/managers/io_struct.py +++ b/python/sglang/srt/managers/io_struct.py @@ -40,7 +40,7 @@ class GenerateReqInput: self.text is not None and self.input_ids is not None ): raise ValueError("Either text or input_ids should be provided.") - if self.sampling_params.get("n", 1) != 1: + if isinstance(self.sampling_params, dict) and self.sampling_params.get("n", 1) != 1: is_single = False else: if self.text is not None: