fzhang commited on
Commit
d650425
1 Parent(s): 9c7416d

fix typo in use_gmask

Browse files
Files changed (1) hide show
  1. modeling_chatglm.py +2 -2
modeling_chatglm.py CHANGED
@@ -929,7 +929,7 @@ class ChatGLMModel(ChatGLMPreTrainedModel):
929
  if position_ids is None:
930
  MASK, gMASK = 150000, 150001
931
  mask_token = MASK if MASK in input_ids else gMASK
932
- use_gmask = False if MASK in input_ids else gMASK
933
 
934
  mask_positions = [seq.tolist().index(mask_token) for seq in input_ids]
935
  position_ids = self.get_position_ids(
@@ -1081,7 +1081,7 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
1081
  batch_size, seq_length = input_ids.shape
1082
  MASK, gMASK = 150000, 150001
1083
  mask_token = MASK if MASK in input_ids else gMASK
1084
- use_gmask = False if MASK in input_ids else gMASK
1085
  seqs = input_ids.tolist()
1086
  mask_positions = [seq.index(mask_token) for seq in seqs]
1087
 
 
929
  if position_ids is None:
930
  MASK, gMASK = 150000, 150001
931
  mask_token = MASK if MASK in input_ids else gMASK
932
+ use_gmask = False if MASK in input_ids else True
933
 
934
  mask_positions = [seq.tolist().index(mask_token) for seq in input_ids]
935
  position_ids = self.get_position_ids(
 
1081
  batch_size, seq_length = input_ids.shape
1082
  MASK, gMASK = 150000, 150001
1083
  mask_token = MASK if MASK in input_ids else gMASK
1084
+ use_gmask = False if MASK in input_ids else True
1085
  seqs = input_ids.tolist()
1086
  mask_positions = [seq.index(mask_token) for seq in seqs]
1087