branin / example.py
sgbaird's picture
Create example.py
76f5bb2
raw
history blame contribute delete
No virus
406 Bytes
from gradio_client import Client
from time import time
client = Client("AccelerationConsortium/branin")
result = client.predict(
3, # float in 'x1' Number component
3, # float in 'x2' Number component
api_name="/predict",
)
print(result)
t0 = time()
results = [client.predict(_, _, api_name="/predict") for _ in range(10)]
print(results)
print(f"Elapsed time: {time() - t0:.2f} seconds")