mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-05-08 08:28:11 +00:00
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
15 lines
532 B
Python
15 lines
532 B
Python
from locust import HttpUser, task
|
|
|
|
|
|
class GenerationUser(HttpUser):
|
|
@task
|
|
def generate(self):
|
|
prompt = "Question: What is the longest river on the earth? Answer:"
|
|
for i in range(4, 9):
|
|
data = {"max_tokens": 2**i, "prompt": prompt}
|
|
with self.client.post("/generation", json=data, catch_response=True) as response:
|
|
if response.status_code in (200, 406):
|
|
response.success()
|
|
else:
|
|
response.failure("Response wrong")
|