Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add status code field #385

Merged
merged 1 commit into from
Dec 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/integration/llm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def check_worker_number(desired):
def send_json(data):
headers = {'content-type': 'application/json'}
res = requests.post(endpoint, headers=headers, json=data)
return res.json()
return res.json(), res.status_code()


def get_gpu_memory():
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_handler(model, model_spec):
params = {"max_length": seq_length}
req["parameters"] = params
logging.info(f"req {req}")
res = send_json(req)
res, _ = send_json(req)
logging.info(f"res {res}")
result = [item[0]['generated_text'] for item in res]
assert len(result) == batch_size
Expand All @@ -109,7 +109,7 @@ def test_ds_raw_model(model):
for seq_length in spec["seq_length"]:
req = {"batch_size": batch_size, "text_length": seq_length, "use_pipeline": spec["use_pipeline"]}
logging.info(f"req: {req}")
res = send_json(req)
res, _ = send_json(req)
logging.info(f"res: {res}")
assert len(res["outputs"]) == batch_size
memory_usage = get_gpu_memory()
Expand All @@ -130,8 +130,8 @@ def test_sd_handler(model, model_spec):
params = {"height": size, "width": size, "steps": step}
req["parameters"] = params
logging.info(f"req: {req}")
res = send_json(req)
assert res["status_code"] == 200
res, status_code = send_json(req)
assert status_code == 200
memory_usage = get_gpu_memory()
logging.info(memory_usage)
for memory in memory_usage:
Expand Down