From ef54a4d604ef3725bd52aa2893f71d671bf5329a Mon Sep 17 00:00:00 2001 From: Shanshan Shen <467638484@qq.com> Date: Tue, 19 May 2026 16:43:16 +0800 Subject: [PATCH] [Misc][MM] Remove redundant code in CLIPAttention (#43046) Signed-off-by: shen-shanshan <467638484@qq.com> --- vllm/model_executor/models/clip.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/vllm/model_executor/models/clip.py b/vllm/model_executor/models/clip.py index 779bbb23e2b..d16bc1d32d7 100644 --- a/vllm/model_executor/models/clip.py +++ b/vllm/model_executor/models/clip.py @@ -397,20 +397,12 @@ class CLIPAttention(nn.Module): ) self.num_heads_per_partition = divide(self.num_heads, self.tp_size) - if attn_cls == MMEncoderAttention: - self.attn = attn_cls( - self.num_heads_per_partition, - self.head_dim, - self.scale, - prefix=f"{prefix}.attn", - ) - else: - self.attn = attn_cls( - self.num_heads_per_partition, - self.head_dim, - self.scale, - prefix=f"{prefix}.attn", - ) + self.attn = attn_cls( + self.num_heads_per_partition, + self.head_dim, + self.scale, + prefix=f"{prefix}.attn", + ) def forward( self,