executor / test.py
leandro
index
90ad763
raw
history blame
488 Bytes
import requests
org_or_user = "lvwerra"
space_name = "executor"
url = f"https://{org_or_user}-{space_name}.hf.space/health"
print(requests.get(url).json())
url = f"https://{org_or_user}-{space_name}.hf.space/restart"
print(requests.post(url).json())
url = f"https://{org_or_user}-{space_name}.hf.space/execute"
print(requests.post(url, json={'code': 'x=10'}).json())
print(requests.post(url, json={'code': 'y=20'}).json())
print(requests.post(url, json={'code': 'print(y*x)'}).json())