solara-test / app.py
maartenbreddels's picture
Update app.py
3b4f871
raw
history blame
612 Bytes
"""This files enables serving Panel apps on Hugging Face Spaces"""
import os
from subprocess import Popen
# CONFIGURE YOUR SETTINGS HERE
# Space separated list of .py or .ipynb files to serve
APP = "solara.website.pages"
# NORMALLY NO NEED TO CHANGE THE BELOW
PORT = os.environ.get("PORT", "7860")
ADDRESS = "0.0.0.0"
command = [
"solara",
"run",
APP,
"--port",
PORT,
"--host",
ADDRESS,
"--log-level-uvicorn",
"debug"
]
#if os.name != "nt":
# command = command + ["--num-procs", "4", "--num-threads", "4"]
print(" ".join(command))
worker = Popen(command)
worker.wait()