Skip to content

Commit

Permalink
chore: make the MistralFunctionCallingAdapter slightly more robust at…
Browse files Browse the repository at this point in the history
… parsing
  • Loading branch information
zhudotexe committed Dec 10, 2024
1 parent 252eec1 commit 5b93954
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kani/prompts/impl/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __init__(self, *args, tool_call_token="[TOOL_CALLS]", eos_token="</s>", **kw

def _parse_tool_calls(self, content: str) -> tuple[str, list[ToolCall]]:
tool_json = re.search(
rf"{re.escape(self.tool_call_token)}\s*(.+?)\s*{re.escape(self.eos_token)}",
rf"{re.escape(self.tool_call_token)}\s*(.+?)\s*({re.escape(self.eos_token)})?$",
content,
re.IGNORECASE | re.DOTALL,
)
Expand Down

0 comments on commit 5b93954

Please sign in to comment.