Update app.py
Browse files
app.py
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
#!/usr/bin/env python
|
2 |
-
|
3 |
-
import os
|
4 |
-
|
5 |
-
import gradio as gr
|
6 |
-
import torch
|
7 |
-
|
8 |
-
from app_image_to_3d import create_demo as create_demo_image_to_3d
|
9 |
-
from app_text_to_3d import create_demo as create_demo_text_to_3d
|
10 |
-
from model import Model
|
11 |
-
|
12 |
-
DESCRIPTION = "# [
|
13 |
-
|
14 |
-
if not torch.cuda.is_available():
|
15 |
-
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
16 |
-
|
17 |
-
model = Model()
|
18 |
-
|
19 |
-
with gr.Blocks(css_paths="style.css") as demo:
|
20 |
-
gr.Markdown(DESCRIPTION)
|
21 |
-
gr.DuplicateButton(
|
22 |
-
value="Duplicate Space for private use",
|
23 |
-
elem_id="duplicate-button",
|
24 |
-
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
|
25 |
-
)
|
26 |
-
with gr.Tabs():
|
27 |
-
with gr.Tab(label="Text to 3D"):
|
28 |
-
create_demo_text_to_3d(model)
|
29 |
-
with gr.Tab(label="Image to 3D"):
|
30 |
-
create_demo_image_to_3d(model)
|
31 |
-
|
32 |
-
if __name__ == "__main__":
|
33 |
-
demo.queue(max_size=10).launch()
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
|
3 |
+
import os
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
import torch
|
7 |
+
|
8 |
+
from app_image_to_3d import create_demo as create_demo_image_to_3d
|
9 |
+
from app_text_to_3d import create_demo as create_demo_text_to_3d
|
10 |
+
from model import Model
|
11 |
+
|
12 |
+
DESCRIPTION = "# [TRIACX](https://github.com/openai/shap-e)"
|
13 |
+
|
14 |
+
if not torch.cuda.is_available():
|
15 |
+
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
16 |
+
|
17 |
+
model = Model()
|
18 |
+
|
19 |
+
with gr.Blocks(css_paths="style.css") as demo:
|
20 |
+
gr.Markdown(DESCRIPTION)
|
21 |
+
gr.DuplicateButton(
|
22 |
+
value="Duplicate Space for private use",
|
23 |
+
elem_id="duplicate-button",
|
24 |
+
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
|
25 |
+
)
|
26 |
+
with gr.Tabs():
|
27 |
+
with gr.Tab(label="Text to 3D"):
|
28 |
+
create_demo_text_to_3d(model)
|
29 |
+
with gr.Tab(label="Image to 3D"):
|
30 |
+
create_demo_image_to_3d(model)
|
31 |
+
|
32 |
+
if __name__ == "__main__":
|
33 |
+
demo.queue(max_size=10).launch()
|