[Frontend][Feature] Add jamba tool parser (#9154)

This commit is contained in:
tomeras91
2024-10-18 10:27:48 +00:00
committed by GitHub
parent 1ffc8a7362
commit d2b1bf55ec
6 changed files with 595 additions and 9 deletions
@@ -63,7 +63,7 @@ class MistralToolParser(ToolParser):
self.bot_token = "[TOOL_CALLS]"
self.bot_token_id = self.vocab.get(self.bot_token)
self.tool_call_regex = re.compile(r"\[{.*?}\]", re.DOTALL)
if not self.bot_token_id:
if self.bot_token_id is None:
raise RuntimeError(
"Mistral Tool Parser could not locate the tool call token in "
"the tokenizer!")