From 357921aa5192da577ed6bf14ebf0c8557abb8c08 Mon Sep 17 00:00:00 2001 From: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Date: Fri, 27 Jun 2025 17:32:29 -0700 Subject: [PATCH] Fix: Minicpm (#7612) Signed-off-by: Xinyuan Tong --- python/sglang/srt/models/minicpmo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/models/minicpmo.py b/python/sglang/srt/models/minicpmo.py index 202b82092..5aa3e9df2 100644 --- a/python/sglang/srt/models/minicpmo.py +++ b/python/sglang/srt/models/minicpmo.py @@ -32,7 +32,7 @@ from transformers.activations import ACT2FN from transformers.cache_utils import DynamicCache, EncoderDecoderCache from transformers.modeling_outputs import BaseModelOutputWithPast, ModelOutput from transformers.models.whisper.modeling_whisper import ( - WHISPER_ATTENTION_CLASSES, + WhisperAttention, WhisperConfig, WhisperEncoder, ) @@ -1090,7 +1090,7 @@ class MiniCPMWhisperEncoderLayer(nn.Module): def __init__(self, config: WhisperConfig, layer_idx: int = None): super().__init__() self.embed_dim = config.d_model - self.self_attn = WHISPER_ATTENTION_CLASSES[config._attn_implementation]( + self.self_attn = WhisperAttention( embed_dim=self.embed_dim, num_heads=config.encoder_attention_heads, dropout=config.attention_dropout,