File size: 488 Bytes
ff98df2
 
 
 
 
 
 
 
90ad763
 
 
ff98df2
90ad763
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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())