update modeling_qwen.py
Browse files- modeling_qwen.py +1 -1
modeling_qwen.py
CHANGED
@@ -524,7 +524,7 @@ class QWenAttention(nn.Module):
|
|
524 |
-1, -1, causal_mask.size(2), -1
|
525 |
)
|
526 |
if causal_mask is not None:
|
527 |
-
attention_mask.
|
528 |
else:
|
529 |
attention_mask = causal_mask
|
530 |
attn_output = F.scaled_dot_product_attention(
|
|
|
524 |
-1, -1, causal_mask.size(2), -1
|
525 |
)
|
526 |
if causal_mask is not None:
|
527 |
+
attention_mask = attention_mask.masked_fill(~causal_mask, torch.finfo(query.dtype).min)
|
528 |
else:
|
529 |
attention_mask = causal_mask
|
530 |
attn_output = F.scaled_dot_product_attention(
|