[ModelRunner V2] Fix whisper test (#46773)
This commit is contained in:
@@ -12,6 +12,9 @@ class EncoderCache:
|
||||
# MM hash -> encoder outputs
|
||||
self.encoder_outputs: dict[str, torch.Tensor] = {}
|
||||
|
||||
def __len__(self) -> int:
|
||||
return len(self.encoder_outputs)
|
||||
|
||||
def add_request(
|
||||
self, req_id: str, mm_features: list[MultiModalFeatureSpec]
|
||||
) -> None:
|
||||
|
||||
@@ -121,10 +121,10 @@ def maybe_create_mm_pruner(
|
||||
) -> MultiModalPruner | None:
|
||||
"""Create a MultiModalPruner if the model prunes embeddings and uses M-RoPE."""
|
||||
if (
|
||||
not rope_state
|
||||
rope_state is None
|
||||
or not rope_state.has_delta
|
||||
or not encoder_cache
|
||||
or not model_config.multimodal_config
|
||||
or encoder_cache is None
|
||||
or model_config.multimodal_config is None
|
||||
or not model_config.multimodal_config.is_multimodal_pruning_enabled()
|
||||
or not supports_multimodal_pruning(model)
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user