From c722ff5160a77a69d767db110c495449dd0aa6b8 Mon Sep 17 00:00:00 2001 From: AllentDan <41138331+AllentDan@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:41:43 +0800 Subject: [PATCH] Add tool role for langchain usage (#2558) --- lmdeploy/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lmdeploy/model.py b/lmdeploy/model.py index 95a5f5412e..d5f47a2fc2 100644 --- a/lmdeploy/model.py +++ b/lmdeploy/model.py @@ -838,10 +838,12 @@ def messages2prompt(self, return self.get_prompt(messages, sequence_start) box_map = dict(user=self.user, ipython=self.ipython, + tool=self.ipython, assistant=self.assistant, system=self.system) eox_map = dict(user=self.eoh, ipython=self.eoi, + tool=self.eoi, assistant=self.eoa + self.separator, system=self.eosys) ret = ''