From 61eee50c9feeb2fe5834469a0fce8ae8e8491fca Mon Sep 17 00:00:00 2001 From: Zhengxiao Du Date: Sat, 8 Apr 2023 02:54:27 +0000 Subject: [PATCH] Fix LogitsProcessor using slim checkpoint (#29) - Fix LogitsProcessor using slim checkpoint (7f8f01fee41efeaac4f926bdb96aea42f1c6076b) Co-authored-by: bcol --- modeling_chatglm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modeling_chatglm.py b/modeling_chatglm.py index 8ee5cf1..9392c13 100644 --- a/modeling_chatglm.py +++ b/modeling_chatglm.py @@ -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