update test to try multi-turn scenarios

This commit is contained in:
Hardik Shah 2025-04-06 12:13:59 -07:00
parent eafbde4e17
commit cd618e9ad0
3 changed files with 198 additions and 64 deletions

View file

@ -203,13 +203,13 @@ class ChatFormat:
tokens.extend(toks)
images.extend(imgs)
if message.role == "assistant" and len(message.tool_calls) > 0:
tokens.append(self.tokenizer.special_tokens["<|python_start|>"])
# if message.role == "assistant" and len(message.tool_calls) > 0:
# tokens.append(self.tokenizer.special_tokens["<|python_start|>"])
_process_content(message.content)
if message.role == "assistant" and len(message.tool_calls) > 0:
tokens.append(self.tokenizer.special_tokens["<|python_end|>"])
# if message.role == "assistant" and len(message.tool_calls) > 0:
# tokens.append(self.tokenizer.special_tokens["<|python_end|>"])
if message.role == "user" and message.context is not None:
# This is RAG context; why is it here in the chat format? I don't think