From 46b872a8541f76614d4db182c350f2171ce1bb3f Mon Sep 17 00:00:00 2001 From: imClumsyPanda Date: Wed, 7 Jun 2023 21:25:40 +0800 Subject: [PATCH] update chatglm_llm.py --- models/chatglm_llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/chatglm_llm.py b/models/chatglm_llm.py index 6e84234..903d488 100644 --- a/models/chatglm_llm.py +++ b/models/chatglm_llm.py @@ -52,7 +52,7 @@ class ChatGLM(BaseAnswer, LLM, ABC): for inum, (stream_resp, _) in enumerate(self.checkPoint.model.stream_chat( self.checkPoint.tokenizer, prompt, - history=history[-self.history_len:] if self.history_len > 0 else [], + history=history[-self.history_len:-1] if self.history_len > 1 else [], max_length=self.max_token, temperature=self.temperature )):