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

This commit is contained in:
tomeras91
2024-10-18 13:27:48 +03:00
committed by GitHub
parent 1ffc8a7362
commit d2b1bf55ec
6 changed files with 595 additions and 9 deletions

View File

@@ -53,7 +53,8 @@ class Hermes2ProToolParser(ToolParser):
self.tool_call_start_token_id = self.vocab.get(
self.tool_call_start_token)
self.tool_call_end_token_id = self.vocab.get(self.tool_call_end_token)
if not self.tool_call_start_token_id or not self.tool_call_end_token_id:
if (self.tool_call_start_token_id is None
or self.tool_call_end_token_id is None):
raise RuntimeError(
"Hermes 2 Pro Tool parser could not locate tool call start/end "
"tokens in the tokenizer!")