From 4a577c361cdc10d17c3bddf791ce77d342d58ab3 Mon Sep 17 00:00:00 2001 From: Geigle Date: Sat, 7 Aug 2021 16:20:53 +0200 Subject: [PATCH] Removed unneeded function --- square-model-inference-api/locust/config.json | 21 ++----------------- .../locust/locustfile.py | 14 ------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/square-model-inference-api/locust/config.json b/square-model-inference-api/locust/config.json index 4e86ebaf6..1b7dd94ba 100644 --- a/square-model-inference-api/locust/config.json +++ b/square-model-inference-api/locust/config.json @@ -1,7 +1,6 @@ { "config": { - - "wait_time": [0, 0.5], + "wait_time": [1, 2], "api_key": "example_key" }, "tasks": [ @@ -18,23 +17,7 @@ "preprocessing_kwargs": { }, "model_kwargs": { }, "task_kwargs": { }, - "adapter_name": "nli/rte@ukp" - } - }, - { - "endpoint": "sequence-classification", - "model": "bert-base-uncased", - "weight": 1, - "query_json": { - "input": - [ - "test input" - ], - "is_preprocessed": false, - "preprocessing_kwargs": { }, - "model_kwargs": { }, - "task_kwargs": { }, - "adapter_name": "nli/rte@ukp" + "adapter_name": "" } } ] diff --git a/square-model-inference-api/locust/locustfile.py b/square-model-inference-api/locust/locustfile.py index a8e4514b4..7738f3278 100644 --- a/square-model-inference-api/locust/locustfile.py +++ b/square-model-inference-api/locust/locustfile.py @@ -4,20 +4,6 @@ from locust.contrib.fasthttp import FastHttpUser -def curry_config_in_task(callable, config, endpoint): - """ - Identical task function might be called with different configs (different model etc.) but Locust calls tasks only - with the user as argument. We curry the task function with the given config into a Locust-callable task function. - :param callable: the task function to use - :param config: the specific config to be used for the task function - :param endpoint: the model API task endpoint that is called - :return: a Locust task function with signature f(user) that calls callable(user, config, model_api_task) - """ - def task(user): - return callable(user, config, endpoint) - return task - - def task_query(config, endpoint): """ Template to make Locust tasks for queries that are generated dynamically based on the given config and endpoint.