sgl-project/sglang · error · ValueError

Load Intern-S2-Mobius through its conditional-generation wra

Error message

Load Intern-S2-Mobius through its conditional-generation wrapper so vision, language, lm_head, and strict coverage are handled together

What it means

The baseline model intentionally disables direct weight loading so users cannot bypass the conditional-generation wrapper, which coordinates vision tower, language model, lm_head, and strict checkpoint coverage checks.

Source

Thrown at python/sglang/srt/models/interns2_mobius.py:821

            ):
                start = self.hidden_size * layer_idx
                hidden_states.add_(
                    input_deepstack_embeds[:, start : start + self.hidden_size]
                )

        if hidden_states.shape[0] != 0:
            if residual is None:
                hidden_states = self.norm(hidden_states)
            else:
                hidden_states, _ = self.norm(hidden_states, residual)
        return (
            hidden_states
            if not aux_hidden_states
            else (hidden_states, aux_hidden_states)
        )

    def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]):
        raise ValueError(
            "Load Intern-S2-Mobius through its conditional-generation wrapper "
            "so vision, language, lm_head, and strict coverage are handled together"
        )


class InternS2MobiusForConditionalGeneration(Qwen3_5ForConditionalGeneration):
    packed_modules_mapping = InternS2MobiusForCausalLM.packed_modules_mapping
    supported_lora_modules = InternS2MobiusForCausalLM.supported_lora_modules

    def __init__(
        self,
        config: InternS2MobiusConfig,
        quant_config: QuantizationConfig | None = None,
        prefix: str = "",
        language_model_cls=InternS2MobiusForCausalLM,
    ) -> None:
        ignored_layers = getattr(quant_config, "ignored_layers", None)
        if (

View on GitHub (pinned to 0132848349)

Solutions

  1. Load weights via InternS2MobiusForConditionalGeneration.load_weights
  2. If you need custom loading, subclass the wrapper rather than the baseline
  3. Pass over the weights untouched to the standard model loader

Example fix

# before
base_model.load_weights(iter(weights))

# after
InternS2MobiusForConditionalGeneration.load_weights(model, iter(weights))
Defensive patterns

Strategy: type-guard

Validate before calling

from sglang.srt.models.interns2_mobius import InternS2MobiusForConditionalGeneration
assert isinstance(model, InternS2MobiusForConditionalGeneration)

Type guard

def supports_direct_load(model) -> bool:
    return not type(model).__name__ == "InternS2MobiusModel"

Prevention

When it happens

Trigger: Calling model.load_weights(weights) on InternS2MobiusModel directly instead of on InternS2MobiusForConditionalGeneration.

Common situations: Custom loaders, weight-conversion scripts, or tooling that grabs the inner text model and loads weights onto it.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/8eff3d22dfb8a9fa. Report an issue: GitHub.