From acf557946272c84563accbe8d64cb4211af43f04 Mon Sep 17 00:00:00 2001 From: Wannaphong Phatthiyaphaibun Date: Thu, 27 Jul 2023 20:50:59 +0700 Subject: [PATCH] Fixed bug #828 Fixed bug #828 --- pythainlp/chat/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythainlp/chat/core.py b/pythainlp/chat/core.py index 6e0a8306a..b4b519009 100644 --- a/pythainlp/chat/core.py +++ b/pythainlp/chat/core.py @@ -87,7 +87,7 @@ def chat(self, text:str)->str: if self.history!=[]: for h,b in self.history: _temp+=self.model.PROMPT_DICT['prompt_chatbot'].format_map({"human":h,"bot":b})+self.model.stop_token - _temp+=self.model.PROMPT_DICT['prompt_chatbot'].format_map({"human":human,"bot":""}) + _temp+=self.model.PROMPT_DICT['prompt_chatbot'].format_map({"human":text,"bot":""}) _bot = self.model.gen_instruct(_temp) self.history.append((text,_bot)) return _bot