Update modeling_gptbert.py
Browse files- modeling_gptbert.py +1 -1
modeling_gptbert.py
CHANGED
|
@@ -394,7 +394,7 @@ class SelfAttention(nn.Module):
|
|
| 394 |
query=query,
|
| 395 |
key=key,
|
| 396 |
value=value,
|
| 397 |
-
attn_mask=attention_mask,
|
| 398 |
dropout_p=self.config.attention_dropout if self.training else 0.0,
|
| 399 |
is_causal=self.is_causal
|
| 400 |
)
|
|
|
|
| 394 |
query=query,
|
| 395 |
key=key,
|
| 396 |
value=value,
|
| 397 |
+
attn_mask=attention_mask if not self.is_causal else None,
|
| 398 |
dropout_p=self.config.attention_dropout if self.training else 0.0,
|
| 399 |
is_causal=self.is_causal
|
| 400 |
)
|