Update modeling_chatglm.py
Browse files- modeling_chatglm.py +1 -1
modeling_chatglm.py
CHANGED
@@ -634,7 +634,7 @@ class ChatGLMPreTrainedModel(PreTrainedModel):
|
|
634 |
if padding_mask is not None:
|
635 |
full_attention_mask = full_attention_mask * padding_mask.unsqueeze(1)
|
636 |
if not past_length and padding_mask is not None:
|
637 |
-
full_attention_mask
|
638 |
full_attention_mask = (full_attention_mask < 0.5).bool()
|
639 |
full_attention_mask.unsqueeze_(1)
|
640 |
return full_attention_mask
|
|
|
634 |
if padding_mask is not None:
|
635 |
full_attention_mask = full_attention_mask * padding_mask.unsqueeze(1)
|
636 |
if not past_length and padding_mask is not None:
|
637 |
+
full_attention_mask = padding_mask.unsqueeze(-1) - 1
|
638 |
full_attention_mask = (full_attention_mask < 0.5).bool()
|
639 |
full_attention_mask.unsqueeze_(1)
|
640 |
return full_attention_mask
|