{"record":{"id":"230ae9ab1d55cf3a","repo":"sgl-project/sglang","slug":"minimaxh3textencodingstage-direct-encode-requires","errorCode":null,"errorMessage":"MiniMaxH3TextEncodingStage direct encode requires a text_encoder component","messagePattern":"MiniMaxH3TextEncodingStage direct encode requires a text_encoder component","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py","lineNumber":275,"sourceCode":"        keyframes = [\n            m for m in plan.materials if m.material_chain == \"image.target_canvas\"\n        ]\n        if plan.task in {\"fl2va\", \"ref2va\"} and keyframes:\n            frame_indices = tuple(material.frame_index for material in keyframes)\n            if frame_indices not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:\n                raise ValueError(\n                    \"MiniMax H3 text encoding requires an ordered keyframe signature \"\n                    f\"in {MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got \"\n                    f\"{frame_indices!r}\"\n                )\n        elif keyframes:\n            raise ValueError(\n                f\"task {plan.task!r} cannot carry image.target_canvas materials\"\n            )\n        if MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY in batch.extra:\n            return\n        if self.text_encoder is None:\n            raise ValueError(\n                \"MiniMaxH3TextEncodingStage direct encode requires a text_encoder \"\n                \"component\"\n            )\n        encode_ids = getattr(self.text_encoder, \"encode_ids\", None)\n        if not callable(encode_ids):\n            raise TypeError(\n                \"MiniMax H3 text_encoder component must expose callable \"\n                \"encode_ids(...) for direct encode (MiniMaxH3Qwen3VLEncoder)\"\n            )\n        if self.tokenizer is None:\n            raise ValueError(\n                \"MiniMaxH3TextEncodingStage direct encode requires a tokenizer component\"\n            )\n        with set_forward_context(current_timestep=0, attn_metadata=None):\n            if plan.task == \"ref2va\":\n                embeddings = self._encode_ref2va(\n                    batch,\n                    plan,","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py#L257-L293","documentation":"Direct plan-driven encode needs the text_encoder pipeline component; if the stage was constructed with text_encoder=None (pipeline lacking the component), _encode_from_plan raises before attempting any encode. Unlike error 2427, this fires lazily at encode time rather than in __init__.","triggerScenarios":"_encode_from_plan proceeds past the cached-embeddings early return while self.text_encoder is None — stage built without the text_encoder component (optional at construction) and now asked to encode directly.","commonSituations":"Pipelines intended to consume precomputed embeddings being fed plans without the embeddings extra key; partial model snapshots missing the Qwen3VL encoder subfolder.","solutions":["Load a pipeline that includes the text_encoder component (MiniMaxH3Qwen3VLEncoder)","Or supply precomputed embeddings via MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY so the encode path short-circuits","Verify model_index.json declares the text_encoder entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if stage.text_encoder is None and MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY not in batch.extra:\n    raise RuntimeError(\"load text_encoder component or supply precomputed embeddings\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load full pipelines (with text_encoder) for direct encode","Pre-populate the embeddings extra key for embedding-only deployments"],"tags":["minimax-h3","missing-component","text-encoding"],"backgroundTag":"missing-pipeline-component","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}