Skip to content
Merged
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
2 changes: 1 addition & 1 deletion vllm/model_executor/models/gemma3_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _find_mm_placeholders(

def get_repl_toks(tok: int) -> list[int]:
if tok == newline_3:
return [newline_2, newline_1]
return [newline_1, newline_2]
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The change from [newline_2, newline_1] to [newline_1, newline_2] is crucial for correctly decomposing the newline_3 token (\n\n\n). While _apply_token_matches (lines 370-380) handles both permutations as equivalent for combining into newline_3, the _find_mm_placeholders function, which uses this decomposition, relies on a specific order for accurate matching of multi-modal placeholders. The previous incorrect order led to a breaking test, highlighting the sensitivity of the system to this sequence. It would be beneficial to add a comment explaining why this specific order is required for decomposition, given that combination is order-agnostic, to prevent future regressions.

Suggested change
return [newline_1, newline_2]
return [newline_1, newline_2] # Decompose as '\n' then '\n\n' for consistent placeholder matching

if tok == newline_4:
return [newline_2, newline_2]

Expand Down
Loading