Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Vsevolod
/
test
like
0
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
main
test
/
run.py
Vsevolod
fixed startup
57bffe7
over 2 years ago
raw
Copy download link
history
blame
contribute
delete
Safe
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
)