Download run.py from Vsevolod/test: direct link, hf CLI and curl.
- Browser
- Download file 200 Bytes
-
https://huggingface.co/spaces/Vsevolod/test/resolve/main/run.py
- Command line
-
hf download hf://spaces/Vsevolod/test/run.py
-
curl -L -o run.py https://huggingface.co/spaces/Vsevolod/test/resolve/main/run.py
200 Bytes
| import os | |
| import subprocess | |
| on_hf_spaces = os.getenv("ON_HF_SPACES") | |
| host = "0.0.0.0" if on_hf_spaces else "localhost" | |
| subprocess.run(f"uvicorn app.main:app --host {host} --port 7860", shell=True) | |