Spaces:
Running on Zero
Running on Zero
debug: wrap build() in try/except to capture Space crash
Browse files
app.py
CHANGED
|
@@ -459,7 +459,19 @@ def build() -> gr.Blocks:
|
|
| 459 |
return demo
|
| 460 |
|
| 461 |
|
| 462 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
|
| 464 |
if __name__ == "__main__" and not os.environ.get("SPACE_ID"):
|
| 465 |
print(f"[chief-engineer] {llm.backend_status()} | seeded {_loaded} lessons this run")
|
|
|
|
| 459 |
return demo
|
| 460 |
|
| 461 |
|
| 462 |
+
try:
|
| 463 |
+
demo = build()
|
| 464 |
+
except Exception as e:
|
| 465 |
+
import traceback
|
| 466 |
+
traceback.print_exc()
|
| 467 |
+
# Fallback: minimal demo so the Space isn't a blank crash
|
| 468 |
+
import gradio as gr
|
| 469 |
+
demo = gr.Interface(
|
| 470 |
+
fn=lambda x: f"Startup error: {e}",
|
| 471 |
+
inputs="text",
|
| 472 |
+
outputs="text",
|
| 473 |
+
title="The Chief Engineer (startup failed)",
|
| 474 |
+
)
|
| 475 |
|
| 476 |
if __name__ == "__main__" and not os.environ.get("SPACE_ID"):
|
| 477 |
print(f"[chief-engineer] {llm.backend_status()} | seeded {_loaded} lessons this run")
|