File size: 361 Bytes
4156f8b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import requests as r
import time
input_data = { "inputs": "Dune is something rarely seen anymore – it’s an epic."}
url = "http://localhost:8080/predict"
sum=0
for i in range(0,1000):
response = r.post(url, json=input_data)
resp_time = response.headers["x-compute-time"]
sum+=float(resp_time)
sum/=1000
print(f"{round(float(sum),6)*1000}ms")
|