/
githubmirror
/
ColossalAI
Обзор
Документация
Войти
/
githubmirror
/
ColossalAI
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/tutorial/opt/inference/benchmark/locustfile.py
14 строк
532 B
Hongxin Liu
[misc] update pre-commit and run all files (#4752)
19 сен 2023, 09:20
Не верифицирован
19 сен 2023, 09:20
079bf3c
Код
Авторство
О чём код?
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")