{"record":{"id":"e9d677b791ff50a8","repo":"sgl-project/sglang","slug":"dots-note-omni-video-preprocessing-requires-one-re","errorCode":null,"errorMessage":"Dots note omni video preprocessing requires one request's sampling_params as a dictionary.","messagePattern":"Dots note omni video preprocessing requires one request's sampling_params as a dictionary\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/dots_note_omni.py","lineNumber":417,"sourceCode":"            request_images,\n            request_audios,\n        )\n\n        if video_data:\n            video_config = dict(request_obj.video_config or {})\n            question = video_config.pop(\"_question\", \"\") or \"\"\n            seq = video_config.pop(\"seq\", 131072)\n            audio_cap = video_config.pop(\"audio_cap\", 1.0)\n            audio_sr = video_config.pop(\"audio_sr\", 16000)\n            k_mode = video_config.pop(\"k_mode\", \"eval_ek\")\n            if video_config:\n                raise ValueError(\n                    \"Unsupported dots note omni video_config fields: \"\n                    + \", \".join(sorted(video_config))\n                )\n            sampling_params = request_obj.sampling_params or {}\n            if not isinstance(sampling_params, dict):\n                raise ValueError(\n                    \"Dots note omni video preprocessing requires one request's \"\n                    \"sampling_params as a dictionary.\"\n                )\n            max_new_tokens = sampling_params.get(\"max_new_tokens\") or 0\n            loop = asyncio.get_running_loop()\n            preprocess_started = time.perf_counter()\n            video_media = {}\n            total_content_items = 0\n            total_frames = 0\n            total_audio_segments = 0\n            for video_index, video in enumerate(video_data):\n                content = await loop.run_in_executor(\n                    self.io_executor,\n                    lambda video=video: preprocess_dots_video(\n                        video,\n                        question,\n                        tokenizer=self._tokenizer,\n                        seq=seq,","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/dots_note_omni.py#L399-L435","documentation":"Raised by process_mm_data_async when request_obj.sampling_params is neither None nor a dict (e.g. a SamplingParams object). The video preprocessing path needs to read max_new_tokens from a plain dictionary.","triggerScenarios":"A request object whose sampling_params is a non-dict object (string, dataclass, already-instantiated SamplingParams) while video_data is present; `sampling_params or {}` returns the truthy non-dict and the isinstance check fails.","commonSituations":"Engine-layer callers that pass typed sampling params objects instead of the raw per-request dict the multimodal processor expects; version drift between sglang layers after SamplingParams was introduced as a class.","solutions":["Pass sampling_params as a plain dict, e.g. {\"max_new_tokens\": 1024}","Or omit it (None) so the default `{}` / max_new_tokens=0 path is used","Update sglang — newer versions may serialize params to dict before the processor"],"exampleFix":"// before\nrequest.sampling_params = SamplingParams(max_new_tokens=1024)\n// after\nrequest.sampling_params = {\"max_new_tokens\": 1024}","handlingStrategy":"type-guard","validationCode":"sp = getattr(request_obj, 'sampling_params', None)\nif sp is not None and not isinstance(sp, dict):\n    request_obj.sampling_params = {'max_new_tokens': getattr(sp, 'max_new_tokens', 0)}","typeGuard":"def sampling_params_is_dict(req) -> bool:\n    sp = getattr(req, 'sampling_params', None)\n    return sp is None or isinstance(sp, dict)","tryCatchPattern":null,"preventionTips":["Pass sampling params as a plain dict in multimodal request objects","Omit sampling_params when no generation budget reservation is needed"],"tags":["multimodal","sampling-params","type-mismatch","valueerror"],"backgroundTag":"invalid-request-payload","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}