Spaces:
Sleeping

Corin1998 commited on
Commit
decb641
·
verified ·
1 Parent(s): 76a460c

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -23
app.py DELETED
@@ -1,23 +0,0 @@
1
- # app.py
2
- import gradio as gr
3
- import traceback, sys, importlib
4
-
5
- def _build_safe_ui() -> gr.Blocks:
6
- try:
7
- dash = importlib.import_module("ui.dash")
8
- if not hasattr(dash, "build_interface"):
9
- raise RuntimeError("ui.dash.build_interface が見つかりません")
10
- ui = dash.build_interface()
11
- if ui is None or not isinstance(ui, gr.Blocks):
12
- raise RuntimeError("build_interface() は gr.Blocks を返してください")
13
- return ui
14
- except Exception:
15
- tb = traceback.format_exc()
16
- print(tb, file=sys.stderr) # ログに詳細
17
- # ← ここで必ず最低限の UI を返す(Spaces が app を検出できるように)
18
- with gr.Blocks(title="Init failed") as demo:
19
- gr.Markdown("### UI init failed\n```\n" + tb + "\n```")
20
- return demo
21
-
22
- # ⛔️ Spaces では launch() を呼ばない。Blocks を app として公開するだけ。
23
- app: gr.Blocks = _build_safe_ui()