Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -333,7 +333,7 @@ def generate(
|
|
333 |
num_steps=64,
|
334 |
randomize_seed=True,
|
335 |
)
|
336 |
-
#
|
337 |
static_folder = os.path.join(os.getcwd(), "static")
|
338 |
if not os.path.exists(static_folder):
|
339 |
os.makedirs(static_folder)
|
@@ -476,6 +476,14 @@ demo = gr.ChatInterface(
|
|
476 |
multimodal=True,
|
477 |
)
|
478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
if __name__ == "__main__":
|
480 |
-
#
|
481 |
-
demo.queue(max_size=20).launch(share=True
|
|
|
333 |
num_steps=64,
|
334 |
randomize_seed=True,
|
335 |
)
|
336 |
+
# Copy the GLB file to a static folder.
|
337 |
static_folder = os.path.join(os.getcwd(), "static")
|
338 |
if not os.path.exists(static_folder):
|
339 |
os.makedirs(static_folder)
|
|
|
476 |
multimodal=True,
|
477 |
)
|
478 |
|
479 |
+
# Ensure the static folder exists
|
480 |
+
if not os.path.exists("static"):
|
481 |
+
os.makedirs("static")
|
482 |
+
|
483 |
+
# Mount the static folder onto the FastAPI app so that GLB files are served.
|
484 |
+
from fastapi.staticfiles import StaticFiles
|
485 |
+
demo.app.mount("/static", StaticFiles(directory="static"), name="static")
|
486 |
+
|
487 |
if __name__ == "__main__":
|
488 |
+
# Launch without the unsupported static_dirs parameter.
|
489 |
+
demo.queue(max_size=20).launch(share=True)
|