fix: kill the usage of python_start and python_end tokens

This commit is contained in:
Ashwin Bharambe 2025-04-05 19:00:26 -07:00
parent 3021c87271
commit 3f92b2bf85

View file

@ -203,14 +203,8 @@ 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|>"])
_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 == "user" and message.context is not None:
# This is RAG context; why is it here in the chat format? I don't think
# this is needed and can be moved upwards