Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
MODEL_PATH = "./mainABC.glb" # put main.glb next to this file
|
| 5 |
+
|
| 6 |
+
def get_model():
|
| 7 |
+
# return a local path (Gradio will serve it)
|
| 8 |
+
return MODEL_PATH if Path(MODEL_PATH).exists() else None
|
| 9 |
+
|
| 10 |
+
with gr.Blocks() as demo:
|
| 11 |
+
gr.Markdown("## 3rd Floor — interactive viewer")
|
| 12 |
+
model_view = gr.Model3D(value=None, label="3D model")
|
| 13 |
+
btn = gr.Button("Load model")
|
| 14 |
+
btn.click(fn=get_model, inputs=None, outputs=model_view)
|
| 15 |
+
|
| 16 |
+
demo.launch()
|