From 25e5ab12827ae3a2b8c25a394795ee1aac3c325a Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Fri, 26 May 2023 01:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0call=5F=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/chatglm_llm.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/models/chatglm_llm.py b/models/chatglm_llm.py index 09970b3..0bd0223 100644 --- a/models/chatglm_llm.py +++ b/models/chatglm_llm.py @@ -39,7 +39,14 @@ class ChatGLM(BaseAnswer, LLM, ABC): self.history_len = history_len def _call(self, prompt: str, stop: Optional[List[str]] = None) -> str: - pass + response, _ = self.checkPoint.model.chat( + self.checkPoint.tokenizer, + prompt, + history=[], + max_length=self.max_token, + temperature=self.temperature + ) + return response def generatorAnswer(self, prompt: str, history: List[List[str]] = [],