Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
AllentDan committed Dec 31, 2024
1 parent 12646b6 commit 23ce3f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lmdeploy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,8 @@ def __init__(
stop_words=['<|im_end|>'],
**kwargs):

self.tool = tools
self.eotool = eotools
self.tools = tools
self.eotools = eotools
super().__init__(system=system,
meta_instruction=meta_instruction,
eosys=eosys,
Expand Down Expand Up @@ -1043,9 +1043,9 @@ def messages2prompt(self,
tool_prompt += self.separator
tool_prompt += f'{{"type": "function", "function": {json.dumps(tool, ensure_ascii=False)}}}'
if len(messages) and messages[0]['role'] == 'system':
ret += f"{self.system}{messages[0]['content']}{self.tool}{tool_prompt}{self.eotool}{self.eosys}"
ret += f"{self.system}{messages[0]['content']}{self.tools}{tool_prompt}{self.eotools}{self.eosys}"
else:
ret += f'{self.system}{self.meta_instruction}{self.tool}{tool_prompt}{self.eotool}{self.eosys}'
ret += f'{self.system}{self.meta_instruction}{self.tools}{tool_prompt}{self.eotools}{self.eosys}'
else:
if self.meta_instruction is not None and sequence_start:
if len(messages) and messages[0]['role'] == 'system':
Expand Down

0 comments on commit 23ce3f8

Please sign in to comment.