Corin1998 commited on
Commit
796c57b
·
verified ·
1 Parent(s): 9e95ace

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -1,23 +1,12 @@
1
- from fastapi import FastAPI
2
- from fastapi.middleware.cors import CORSMiddleware
3
  import gradio as gr
4
 
5
- # --- Gradio UI(超最小)
6
  def ping():
7
- return "pong 🎯"
8
 
9
- with gr.Blocks(title="Boot Probe") as demo:
10
  btn = gr.Button("Ping")
11
- out = gr.Markdown("Click the button")
12
  btn.click(fn=ping, inputs=None, outputs=out)
13
 
14
- # --- FastAPI アプリを作成し、Gradioをマウント
15
- app = FastAPI(title="Agent Studio - Python SDK")
16
-
17
- app.add_middleware(
18
- CORSMiddleware,
19
- allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"],
20
- )
21
-
22
- # ルートにGradioをマウント(/ でUIが出ます)
23
- app = gr.mount_gradio_app(app, demo, path="/")
 
 
 
1
  import gradio as gr
2
 
 
3
  def ping():
4
+ return "pong"
5
 
6
+ with gr.Blocks(title="Gradio Boot") as demo:
7
  btn = gr.Button("Ping")
8
+ out = gr.Markdown("Click Ping")
9
  btn.click(fn=ping, inputs=None, outputs=out)
10
 
11
+ # 念のため両名をエクスポート
12
+ app = demo