[ModelRunner V2] Fix whisper test (#46773)

Nick Hill committed Jun 25, 2026 at 22:10 UTC 5b33041746b9b9ab45bdbd9b42cdd5d19357879a
2 files changed +6 -3
vllm/v1/worker/gpu/mm/encoder_cache.py
+3
@@ -12,6 +12,9 @@ class EncoderCache:
12 # MM hash -> encoder outputs
13 self.encoder_outputs: dict[str, torch.Tensor] = {}
14
15 + def __len__(self) -> int:
16 + return len(self.encoder_outputs)
17 +
18 def add_request(
19 self, req_id: str, mm_features: list[MultiModalFeatureSpec]
20 ) -> None:
vllm/v1/worker/gpu/model_states/mm_pruning.py
+3 -3
@@ -121,10 +121,10 @@ def maybe_create_mm_pruner(
121 ) -> MultiModalPruner | None:
122 """Create a MultiModalPruner if the model prunes embeddings and uses M-RoPE."""
123 if (
124 - not rope_state
124 + rope_state is None
125 or not rope_state.has_delta
126 - or not encoder_cache
127 - or not model_config.multimodal_config
126 + or encoder_cache is None
127 + or model_config.multimodal_config is None
128 or not model_config.multimodal_config.is_multimodal_pruning_enabled()
129 or not supports_multimodal_pruning(model)
130 ):