Skip to content

Commit

Permalink
Removed unneeded function
Browse files Browse the repository at this point in the history
  • Loading branch information
Geigle committed Aug 7, 2021
1 parent bd6fdba commit 4a577c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
21 changes: 2 additions & 19 deletions square-model-inference-api/locust/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"config": {

"wait_time": [0, 0.5],
"wait_time": [1, 2],
"api_key": "example_key"
},
"tasks": [
Expand All @@ -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": ""
}
}
]
Expand Down
14 changes: 0 additions & 14 deletions square-model-inference-api/locust/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4a577c3

Please sign in to comment.