18 lines
661 B
Python
18 lines
661 B
Python
from locust import HttpUser, task, between
|
|
|
|
class MultiModalUser(HttpUser):
|
|
wait_time = between(1, 3)
|
|
|
|
@task
|
|
def text_query(self):
|
|
self.client.post("/api/predict", json={"input": "What is the capital of France?"})
|
|
|
|
# @task
|
|
# def image_query(self):
|
|
# with open("test_image.jpg", "rb") as f:
|
|
# self.client.post("/api/image_predict", files={"file": f}, data={"question": "What is in this image?"})
|
|
|
|
# @task
|
|
# def video_query(self):
|
|
# with open("test_video.mp4", "rb") as f:
|
|
# self.client.post("/api/video_predict", files={"file": f}, data={"question": "What is happening in this video?"}) |