This commit is contained in:
duzx16 2023-04-08 12:04:14 +08:00
commit 6650ae3a53
1 changed files with 1 additions and 1 deletions

View File

@ -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