Upload modeling_minicpmo.py with huggingface_hub
Browse files- modeling_minicpmo.py +2 -2
modeling_minicpmo.py
CHANGED
|
@@ -56,7 +56,7 @@ from transformers.cache_utils import StaticCache
|
|
| 56 |
from transformers.modeling_outputs import BaseModelOutputWithPast
|
| 57 |
from transformers.modeling_outputs import ModelOutput
|
| 58 |
from transformers.models.whisper.modeling_whisper import ACT2FN
|
| 59 |
-
from transformers.models.whisper.modeling_whisper import
|
| 60 |
from transformers.models.whisper.modeling_whisper import WhisperConfig
|
| 61 |
from transformers.models.whisper.modeling_whisper import WhisperEncoder
|
| 62 |
|
|
@@ -1890,7 +1890,7 @@ class MiniCPMWhisperEncoderLayer(nn.Module):
|
|
| 1890 |
def __init__(self, config: WhisperConfig, layer_idx: int = None):
|
| 1891 |
super().__init__()
|
| 1892 |
self.embed_dim = config.d_model
|
| 1893 |
-
self.self_attn =
|
| 1894 |
embed_dim=self.embed_dim,
|
| 1895 |
num_heads=config.encoder_attention_heads,
|
| 1896 |
dropout=config.attention_dropout,
|
|
|
|
| 56 |
from transformers.modeling_outputs import BaseModelOutputWithPast
|
| 57 |
from transformers.modeling_outputs import ModelOutput
|
| 58 |
from transformers.models.whisper.modeling_whisper import ACT2FN
|
| 59 |
+
from transformers.models.whisper.modeling_whisper import WhisperAttention
|
| 60 |
from transformers.models.whisper.modeling_whisper import WhisperConfig
|
| 61 |
from transformers.models.whisper.modeling_whisper import WhisperEncoder
|
| 62 |
|
|
|
|
| 1890 |
def __init__(self, config: WhisperConfig, layer_idx: int = None):
|
| 1891 |
super().__init__()
|
| 1892 |
self.embed_dim = config.d_model
|
| 1893 |
+
self.self_attn = WhisperAttention(
|
| 1894 |
embed_dim=self.embed_dim,
|
| 1895 |
num_heads=config.encoder_attention_heads,
|
| 1896 |
dropout=config.attention_dropout,
|