Spaces:
Runtime error
Runtime error
cocktailpeanut
commited on
Commit
•
c6b09d3
1
Parent(s):
43a9fe4
mkdir public if one doesn't exist (#28)
Browse files- app_init.py +4 -0
app_init.py
CHANGED
@@ -13,6 +13,7 @@ import time
|
|
13 |
from types import SimpleNamespace
|
14 |
from util import pil_to_frame, bytes_to_pil, is_firefox
|
15 |
import asyncio
|
|
|
16 |
|
17 |
|
18 |
def init_app(app: FastAPI, user_data: UserData, args: Args, pipeline):
|
@@ -153,4 +154,7 @@ def init_app(app: FastAPI, user_data: UserData, args: Args, pipeline):
|
|
153 |
}
|
154 |
)
|
155 |
|
|
|
|
|
|
|
156 |
app.mount("/", StaticFiles(directory="public", html=True), name="public")
|
|
|
13 |
from types import SimpleNamespace
|
14 |
from util import pil_to_frame, bytes_to_pil, is_firefox
|
15 |
import asyncio
|
16 |
+
import os
|
17 |
|
18 |
|
19 |
def init_app(app: FastAPI, user_data: UserData, args: Args, pipeline):
|
|
|
154 |
}
|
155 |
)
|
156 |
|
157 |
+
if not os.path.exists("public"):
|
158 |
+
os.makedirs("public")
|
159 |
+
|
160 |
app.mount("/", StaticFiles(directory="public", html=True), name="public")
|