yangapku commited on
Commit
01f9563
1 Parent(s): 4907f19

update modeling_qwen.py

Browse files
Files changed (1) hide show
  1. 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.masked_fill_(~causal_mask, torch.finfo(query.dtype).min)
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(