mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-11-03 02:53:26 +08:00
Optimization of ‘tools’ in request fields (#4380)
* Remove multiple 'tools' * Remove multiple 'tools' * Remove multiple 'tools' * Remove multiple 'tools'
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user