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
16 changes: 0 additions & 16 deletions vllm_omni/patch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import sys
from functools import cached_property as _cached_property

from aenum import extend_enum
Comment on lines 1 to 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep Bagel mm_prefix_lm patch for vLLM 0.17 users

This change removes the ModelConfig.is_mm_prefix_lm override in vllm_omni.patch, but the repo still documents and builds against vLLM 0.17 (docs/getting_started/quickstart.md:22-25, docker/Dockerfile.ci:2). In those environments Bagel is not in upstream MM_PREFIX_LM_MODELS, so dropping this fallback disables the bidirectional-prefix behavior Bagel needs and can break Bagel inference paths. Either keep the patch for pre-0.18 versions or gate this removal behind an enforced minimum vLLM version.

Useful? React with 👍 / 👎.

from vllm.config import ModelConfig as _ModelConfig
from vllm.inputs.data import TokensPrompt as _OriginalTokensPrompt
from vllm.model_executor.layers.rotary_embedding import (
MRotaryEmbedding as _OriginalMRotaryEmbedding,
Expand Down Expand Up @@ -45,20 +43,6 @@ def _patched_glm_image_text_config_init(self, *args, **kwargs):
# GlmImageTextConfig not available, skip patching
pass


# Patch ModelConfig.is_mm_prefix_lm to include Bagel (bidirectional attention
# for multimodal prefix positions, same as Gemma3/Molmo2/PaliGemma).
_orig_is_mm_prefix_lm = _ModelConfig.__dict__["is_mm_prefix_lm"].func


@_cached_property
def _patched_is_mm_prefix_lm(self) -> bool:
return _orig_is_mm_prefix_lm(self) or getattr(self.hf_config, "model_type", None) == "bagel"


_patched_is_mm_prefix_lm.__set_name__(_ModelConfig, "is_mm_prefix_lm")
_ModelConfig.is_mm_prefix_lm = _patched_is_mm_prefix_lm

# Extend RequestStatus enum with omni-specific statuses
if not hasattr(RequestStatus, "WAITING_FOR_CHUNK"):
# The value - 1 is intentionally chosen to ensure it is treated
Expand Down