File size: 612 Bytes
1bf7a1c
 
 
 
 
 
 
9f2342f
1bf7a1c
 
 
 
9f2342f
 
 
1bf7a1c
 
9f2342f
1bf7a1c
3b4f871
 
1bf7a1c
9f2342f
 
1bf7a1c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""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()