Spaces:
Sleeping
Sleeping
Download test.py from lvwerra/executor: direct link, hf CLI and curl.
- Browser
- Download file 488 Bytes
-
https://huggingface.co/spaces/lvwerra/executor/resolve/refs%2Fpr%2F1/test.py
- Command line
-
hf download hf://spaces/lvwerra/executor@refs/pr/1/test.py
-
curl -L -o test.py https://huggingface.co/spaces/lvwerra/executor/resolve/refs%2Fpr%2F1/test.py
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()) |