Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions vllm/model_executor/models/gemma3_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,12 @@ class Gemma3ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP,
"model.vision_tower.": "vision_tower.",
"model.multi_modal_projector.": "multi_modal_projector.",
"lm_head.": "language_model.lm_head.",
"vision_tower.vision_model.": "vision_model.",
})
},
orig_to_new_substr={
# mapping for llm-compressor quantized checkpoints
"vision_model.vision_model.": "vision_model.",
},
)
Comment on lines +482 to +487
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Moving the orig_to_new_substr mapping into its own dictionary improves readability and organization. This change also ensures that the mapping for quantized checkpoints is correctly applied, fixing the weights loading issue. However, it would be more readable if the orig_to_new_substr dictionary was defined before the orig_to_new_prefix dictionary.

        orig_to_new_substr={
            # mapping for llm-compressor quantized checkpoints
            "vision_model.vision_model.": "vision_model.",
        },
        orig_to_new_prefix={


def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
super().__init__()
Expand Down