Optimization of ‘tools’ in request fields (#4380)

* Remove multiple 'tools'

* Remove multiple 'tools'

* Remove multiple 'tools'

* Remove multiple 'tools'
This commit is contained in:
zhuzixuan
2025-10-20 11:04:08 +08:00
committed by GitHub
parent 528c55776e
commit 1e59905e34
2 changed files with 4 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ class EngineClient:
task["preprocess_start_time"] = time.time()
try:
chat_template_kwargs = task.get("chat_template_kwargs") or {}
chat_template_kwargs.update({"chat_template": task.get("chat_template"), "tools": task.get("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)

View File

@@ -28,9 +28,10 @@ class TestEngineClient(unittest.IsolatedAsyncioTestCase):
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__":