Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Tiny runner so Spaces can start; immediately run and exit.
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import threading, time, sys
|
| 4 |
+
from builder import run
|
| 5 |
+
|
| 6 |
+
def _bg():
|
| 7 |
+
try:
|
| 8 |
+
run()
|
| 9 |
+
except Exception as e:
|
| 10 |
+
print("Builder failed:", e, flush=True)
|
| 11 |
+
|
| 12 |
+
t = threading.Thread(target=_bg, daemon=True)
|
| 13 |
+
t.start()
|
| 14 |
+
|
| 15 |
+
def status():
|
| 16 |
+
return "Builder running... Check logs. It will stop when finished."
|
| 17 |
+
|
| 18 |
+
demo = gr.Interface(fn=status, inputs=None, outputs="text", title="MaterialMind – Builder")
|
| 19 |
+
demo.queue().launch()
|