sgl-project/sglang · error · ValueError
MiniMaxH3TextEncodingStage direct encode requires a…
Error message
MiniMaxH3TextEncodingStage direct encode requires a tokenizer component
What it means
Direct encode also requires the tokenizer pipeline component; if self.tokenizer is None at encode time, _encode_from_plan raises this ValueError. Like 2436, it fires lazily — construction allows a tokenizer-less pipeline (embedding-only usage) but direct encode does not.
Solutions
- Load the pipeline with its tokenizer component included
- Pre-populate MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY to bypass direct encode
- Verify the tokenizer entry exists in model_index.json
Defensive patterns
Strategy: validation
Validate before calling
if stage.tokenizer is None and MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY not in batch.extra:
raise RuntimeError("load tokenizer component or supply precomputed embeddings") Prevention
- Include the tokenizer subfolder when exporting/shipping pipelines
- For embedding-replay setups, always attach the embeddings extra key
When it happens
Trigger: _encode_from_plan reaches the tokenizer check with self.tokenizer None — stage constructed from a pipeline missing the tokenizer component while the plan has no cached text embeddings.
Common situations: Slim pipelines shipping only the diffusion model and encoder weights, tokenizer subfolder excluded from the snapshot, or embedding-replay setups accidentally receiving fresh plans.
Related errors
- MiniMax H3 Qwen3-VL encoders smaller than 32B require…
- MiniMaxH3TextEncodingStage direct encode requires a…
- A tokenizer is required to load an external ngram corpus.
- adaln out_features mismatch
- adapt_shape_v1 ratio must be within the inclusive range 1:4…
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/8c3aa9e0c2f9b64e.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py:286
elif keyframes:
raise ValueError(
f"task {plan.task!r} cannot carry image.target_canvas materials"
)
if MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY in batch.extra:
return
if self.text_encoder is None:
raise ValueError(
"MiniMaxH3TextEncodingStage direct encode requires a text_encoder "
"component"
)
encode_ids = getattr(self.text_encoder, "encode_ids", None)
if not callable(encode_ids):
raise TypeError(
"MiniMax H3 text_encoder component must expose callable "
"encode_ids(...) for direct encode (MiniMaxH3Qwen3VLEncoder)"
)
if self.tokenizer is None:
raise ValueError(
"MiniMaxH3TextEncodingStage direct encode requires a tokenizer component"
)
with set_forward_context(current_timestep=0, attn_metadata=None):
if plan.task == "ref2va":
embeddings = self._encode_ref2va(
batch,
plan,
encode_ids,
include_video_token_mask=include_video_token_mask,
)
elif keyframes:
embeddings = self._encode_fl2va_keyframes(
batch,
plan,
encode_ids,
prompt=prompt,
)
else:View on GitHub (pinned to 0132848349)