From 00114c67215ae6f9fede3a14eee664f97a000aba Mon Sep 17 00:00:00 2001 From: zhuzixuan Date: Mon, 13 Oct 2025 19:54:59 +0800 Subject: [PATCH 1/4] Remove multiple 'tools' --- fastdeploy/input/text_processor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastdeploy/input/text_processor.py b/fastdeploy/input/text_processor.py index a29e1b2605a..ee7205174ce 100644 --- a/fastdeploy/input/text_processor.py +++ b/fastdeploy/input/text_processor.py @@ -540,6 +540,8 @@ def messages2ids(self, request, **kwargs): List[int]: ID sequences """ + if "tools" in kwargs: + kwargs.pop("tools") spliced_message = self.tokenizer.apply_chat_template( request, tokenize=False, From 46043146819452ca7db5ce2209acc1d70e6313c2 Mon Sep 17 00:00:00 2001 From: zhuzixuan Date: Tue, 14 Oct 2025 14:31:15 +0800 Subject: [PATCH 2/4] Remove multiple 'tools' --- fastdeploy/entrypoints/engine_client.py | 2 ++ fastdeploy/input/text_processor.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fastdeploy/entrypoints/engine_client.py b/fastdeploy/entrypoints/engine_client.py index 525498ed5ce..3b010d16406 100644 --- a/fastdeploy/entrypoints/engine_client.py +++ b/fastdeploy/entrypoints/engine_client.py @@ -174,6 +174,8 @@ async def add_requests(self, task): try: chat_template_kwargs = task.get("chat_template_kwargs", {}) chat_template_kwargs.update({"chat_template": task.get("chat_template"), "tools": task.get("tools")}) + if "tools" in chat_template_kwargs: + chat_template_kwargs.pop("tools") task["chat_template_kwargs"] = chat_template_kwargs if inspect.iscoroutinefunction(self.data_processor.process_request_dict): await self.data_processor.process_request_dict(task, self.max_model_len) diff --git a/fastdeploy/input/text_processor.py b/fastdeploy/input/text_processor.py index ee7205174ce..a29e1b2605a 100644 --- a/fastdeploy/input/text_processor.py +++ b/fastdeploy/input/text_processor.py @@ -540,8 +540,6 @@ def messages2ids(self, request, **kwargs): List[int]: ID sequences """ - if "tools" in kwargs: - kwargs.pop("tools") spliced_message = self.tokenizer.apply_chat_template( request, tokenize=False, From 1dccf6dc3adc8164f797d54435ec6496f05c2c39 Mon Sep 17 00:00:00 2001 From: zhuzixuan Date: Wed, 15 Oct 2025 21:13:37 +0800 Subject: [PATCH 3/4] Remove multiple 'tools' --- tests/entrypoints/test_engine_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/entrypoints/test_engine_client.py b/tests/entrypoints/test_engine_client.py index e11fa54939e..5ff14771c4a 100644 --- a/tests/entrypoints/test_engine_client.py +++ b/tests/entrypoints/test_engine_client.py @@ -27,9 +27,10 @@ async def test_add_request(self): await self.engine_client.add_requests(request) assert "chat_template" in request["chat_template_kwargs"], "'chat_template' not found in 'chat_template_kwargs" - assert "tools" in request["chat_template_kwargs"], "'tools' not found in 'chat_template_kwargs'" + # assert "tools" in request["chat_template_kwargs"], "'tools' not found in 'chat_template_kwargs'" assert request["chat_template_kwargs"]["chat_template"] == "Hello" - assert request["chat_template_kwargs"]["tools"] == [1] + assert request["tools"] == [1] + # assert request["chat_template_kwargs"]["tools"] == [1] if __name__ == "__main__": From 1d34905fb900a191761c787784720a884fb65d8e Mon Sep 17 00:00:00 2001 From: zhuzixuan Date: Thu, 16 Oct 2025 15:28:30 +0800 Subject: [PATCH 4/4] Remove multiple 'tools' --- fastdeploy/entrypoints/engine_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fastdeploy/entrypoints/engine_client.py b/fastdeploy/entrypoints/engine_client.py index 3b010d16406..273dea5988c 100644 --- a/fastdeploy/entrypoints/engine_client.py +++ b/fastdeploy/entrypoints/engine_client.py @@ -173,9 +173,7 @@ async def add_requests(self, task): task["preprocess_start_time"] = time.time() try: chat_template_kwargs = task.get("chat_template_kwargs", {}) - chat_template_kwargs.update({"chat_template": task.get("chat_template"), "tools": task.get("tools")}) - if "tools" in chat_template_kwargs: - chat_template_kwargs.pop("tools") + chat_template_kwargs.update({"chat_template": task.get("chat_template")}) task["chat_template_kwargs"] = chat_template_kwargs if inspect.iscoroutinefunction(self.data_processor.process_request_dict): await self.data_processor.process_request_dict(task, self.max_model_len)