sgl-project/sglang · error · ValueError
Dots note omni video preprocessing requires one request's sa
Error message
Dots note omni video preprocessing requires one request's sampling_params as a dictionary.
What it means
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.
Source
Thrown at python/sglang/srt/multimodal/processors/dots_note_omni.py:417
request_images,
request_audios,
)
if video_data:
video_config = dict(request_obj.video_config or {})
question = video_config.pop("_question", "") or ""
seq = video_config.pop("seq", 131072)
audio_cap = video_config.pop("audio_cap", 1.0)
audio_sr = video_config.pop("audio_sr", 16000)
k_mode = video_config.pop("k_mode", "eval_ek")
if video_config:
raise ValueError(
"Unsupported dots note omni video_config fields: "
+ ", ".join(sorted(video_config))
)
sampling_params = request_obj.sampling_params or {}
if not isinstance(sampling_params, dict):
raise ValueError(
"Dots note omni video preprocessing requires one request's "
"sampling_params as a dictionary."
)
max_new_tokens = sampling_params.get("max_new_tokens") or 0
loop = asyncio.get_running_loop()
preprocess_started = time.perf_counter()
video_media = {}
total_content_items = 0
total_frames = 0
total_audio_segments = 0
for video_index, video in enumerate(video_data):
content = await loop.run_in_executor(
self.io_executor,
lambda video=video: preprocess_dots_video(
video,
question,
tokenizer=self._tokenizer,
seq=seq,View on GitHub (pinned to 0132848349)
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
Example fix
// before
request.sampling_params = SamplingParams(max_new_tokens=1024)
// after
request.sampling_params = {"max_new_tokens": 1024} Defensive patterns
Strategy: type-guard
Validate before calling
sp = getattr(request_obj, 'sampling_params', None)
if sp is not None and not isinstance(sp, dict):
request_obj.sampling_params = {'max_new_tokens': getattr(sp, 'max_new_tokens', 0)} Type guard
def sampling_params_is_dict(req) -> bool:
sp = getattr(req, 'sampling_params', None)
return sp is None or isinstance(sp, dict) Prevention
- Pass sampling params as a plain dict in multimodal request objects
- Omit sampling_params when no generation budget reservation is needed
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- max_new_tokens must be non-negative, got {max_new_tokens}
- seq must be positive, got {seq}
- max_new_tokens must leave room for input: max_new_tokens={ma
- audio_cap must be non-negative, got {audio_cap}
- audio_sr must be positive, got {audio_sr}
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/e9d677b791ff50a8.
Report an issue: GitHub.