Spaces:
Runtime error
Runtime error
Commit
·
9f2342f
1
Parent(s):
c1f0208
Update app.py
Browse files
app.py
CHANGED
@@ -5,34 +5,21 @@ from subprocess import Popen
|
|
5 |
# CONFIGURE YOUR SETTINGS HERE
|
6 |
|
7 |
# Space separated list of .py or .ipynb files to serve
|
8 |
-
|
9 |
-
# Prefix of the index .py or .ipynb file. Must be in APPS_TO_SERVE too
|
10 |
-
INDEX_PAGE = "index"
|
11 |
-
|
12 |
# NORMALLY NO NEED TO CHANGE THE BELOW
|
13 |
PORT = os.environ.get("PORT", "7860")
|
14 |
ADDRESS = "0.0.0.0"
|
15 |
command = [
|
16 |
-
"
|
17 |
-
"
|
18 |
-
|
19 |
-
"--index",
|
20 |
-
INDEX_PAGE,
|
21 |
"--port",
|
22 |
PORT,
|
23 |
-
"--
|
24 |
ADDRESS,
|
25 |
-
"--allow-websocket-origin",
|
26 |
-
"localhost",
|
27 |
-
"--allow-websocket-origin",
|
28 |
-
"*.hf.space",
|
29 |
-
"--allow-websocket-origin",
|
30 |
-
"*.huggingface.co",
|
31 |
-
# "--log-level",
|
32 |
-
# "debug"
|
33 |
]
|
34 |
-
if os.name != "nt":
|
35 |
-
command = command + ["--num-procs", "4", "--num-threads", "4"]
|
36 |
|
37 |
print(" ".join(command))
|
38 |
worker = Popen(command)
|
|
|
5 |
# CONFIGURE YOUR SETTINGS HERE
|
6 |
|
7 |
# Space separated list of .py or .ipynb files to serve
|
8 |
+
APP = "solara.website.pages"
|
|
|
|
|
|
|
9 |
# NORMALLY NO NEED TO CHANGE THE BELOW
|
10 |
PORT = os.environ.get("PORT", "7860")
|
11 |
ADDRESS = "0.0.0.0"
|
12 |
command = [
|
13 |
+
"solara",
|
14 |
+
"run",
|
15 |
+
APP,
|
|
|
|
|
16 |
"--port",
|
17 |
PORT,
|
18 |
+
"--host",
|
19 |
ADDRESS,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
]
|
21 |
+
#if os.name != "nt":
|
22 |
+
# command = command + ["--num-procs", "4", "--num-threads", "4"]
|
23 |
|
24 |
print(" ".join(command))
|
25 |
worker = Popen(command)
|