Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: ssbuild <[email protected]>
  • Loading branch information
ssbuild committed Mar 27, 2023
1 parent 7c92997 commit cb95857
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nlp/models/chatglm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ def get_position_ids(self, input_ids):
cond2 = torch.where(input_ids[0] == SPTokens.gMASK)[0]

assert len(cond1) > 0 or len(cond2) > 0 , ValueError('ou have to add either [MASK] or [gMASK] in your input')
use_gmask = False if len(cond1) in input_ids else SPTokens.gMASK
use_gmask = False if len(cond1) else SPTokens.gMASK
mask_position = cond1[0] if len(cond1) > 0 else cond2[0]

if self.position_encoding_2d:
Expand Down

0 comments on commit cb95857

Please sign in to comment.