Merge branch 'main' of https://huggingface.co/THUDM/chatglm-6b
This commit is contained in:
commit
6650ae3a53
|
@ -55,7 +55,7 @@ class InvalidScoreLogitsProcessor(LogitsProcessor):
|
|||
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
|
||||
if torch.isnan(scores).any() or torch.isinf(scores).any():
|
||||
scores.zero_()
|
||||
scores[..., 20005] = 5e4
|
||||
scores[..., 5] = 5e4
|
||||
return scores
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue