From 101a7f833b05cc9abd34a4316839559316158c65 Mon Sep 17 00:00:00 2001 From: gaozixiang Date: Mon, 11 Nov 2024 16:40:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3role=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lmdeploy/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmdeploy/model.py b/lmdeploy/model.py index 99797abb68..e66daa438b 100644 --- a/lmdeploy/model.py +++ b/lmdeploy/model.py @@ -975,7 +975,7 @@ def messages2prompt(self, messages, sequence_start=True, ret += f'\n\n{{"name": "{toolCall["name"]}, "arguments": {json.dumps(tools["arguments"])}"\n}}' if message['role'] == 'tool': if index == 0 or messages[index - 1]['role'] != 'tool': - ret += f"{box_map[message['role']]}" + ret += f"{self.user}" ret += f"\n\n{message['content']}\n" if index == len(messages) - 1 or messages[index + 1]['role'] != 'tool': ret += f"{self.eoh}"