diff --git a/lmdeploy/model.py b/lmdeploy/model.py
index 57466fd79c..83023d378f 100644
--- a/lmdeploy/model.py
+++ b/lmdeploy/model.py
@@ -950,7 +950,7 @@ def __init__(
assistant='<|im_start|>assistant\n',
eoa='<|im_end|>',
separator='\n',
- tools="""\n#Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n\n""",
+ tools="""\n#Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n""",
eotools="""\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{"name": , "arguments": }\n""",
stop_words=['<|im_end|>'],
**kwargs):
@@ -990,6 +990,7 @@ def messages2prompt(self,
tool_prompt = ''
if tools is not None:
for tool in tools:
+ tool_prompt += '\n'
tool_prompt += json.dumps(tool, ensure_ascii=False)
if len(messages) and messages[0]['role'] == 'system':
ret += f"{self.system}{messages[0]['content']}{self.tools}{tool_prompt}{self.eotools}{self.eosys}"