Skip to content

vllm_omni.model_executor.models.mammoth_moda2

Modules:

Name Description
mammoth_moda2
pipeline_mammothmoda2_dit

Compatibility shim.

MammothModa2ARForConditionalGeneration

Bases: Qwen2_5_VLForConditionalGeneration

Replaces the language backbone with MoE within the Qwen2_5_VLForConditionalGeneration multi-modal framework.

have_multimodal_outputs class-attribute instance-attribute

have_multimodal_outputs = True

hf_to_vllm_mapper class-attribute instance-attribute

hf_to_vllm_mapper = WeightsMapper(
    orig_to_new_prefix={
        "gen_image_condition_refiner.": None,
        "gen_transformer.": None,
        "gen_vae.": None,
        "llm_model.model.language_model.gen_embed_tokens.": "language_model.gen_embed_tokens.",
        "llm_model.gen_head.": "language_model.gen_head.",
        "llm_model.model.language_model.": "language_model.",
        "llm_model.model.visual.": "visual.",
        "llm_model.lm_head.": "language_model.lm_head.",
    }
)

language_model instance-attribute

language_model = init_vllm_registered_model(
    vllm_config=ar_vllm_config,
    prefix=maybe_prefix(prefix, "language_model"),
    hf_config=lm_hf_config,
    architectures=["MammothModa2Qwen2ForCausalLM"],
)

make_empty_intermediate_tensors instance-attribute

make_empty_intermediate_tensors = (
    make_empty_intermediate_tensors
)

compute_logits

compute_logits(hidden_states: Tensor | OmniOutput)

forward

forward(
    input_ids: Tensor,
    positions: Tensor,
    intermediate_tensors: IntermediateTensors | None = None,
    inputs_embeds: Tensor | None = None,
    **kwargs: Any,
)