From 3f92b2bf85df6762b039c22ef54c6cad3c45f2c9 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Sat, 5 Apr 2025 19:00:26 -0700 Subject: [PATCH] fix: kill the usage of python_start and python_end tokens --- llama_stack/models/llama/llama4/chat_format.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/llama_stack/models/llama/llama4/chat_format.py b/llama_stack/models/llama/llama4/chat_format.py index d84409ae1..e673cba16 100644 --- a/llama_stack/models/llama/llama4/chat_format.py +++ b/llama_stack/models/llama/llama4/chat_format.py @@ -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