Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,18 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
-
from omr_backend import app
|
| 4 |
|
| 5 |
|
| 6 |
@spaces.GPU(duration=60)
|
| 7 |
def zero_gpu_ready():
|
| 8 |
-
return "ZeroGPU
|
| 9 |
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
fn=
|
| 17 |
-
inputs=[],
|
| 18 |
-
outputs=gr.Textbox(label="Gateway status"),
|
| 19 |
-
title="OMR Comparator Backend",
|
| 20 |
-
description="FastAPI gateway for the OMR model comparison app.",
|
| 21 |
-
)
|
| 22 |
-
|
| 23 |
-
app = gr.mount_gradio_app(app, demo, path="/")
|
| 24 |
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
+
from omr_backend import app as fastapi_app
|
| 4 |
|
| 5 |
|
| 6 |
@spaces.GPU(duration=60)
|
| 7 |
def zero_gpu_ready():
|
| 8 |
+
return "ZeroGPU function detected and available."
|
| 9 |
|
| 10 |
|
| 11 |
+
with gr.Blocks(title="OMR Comparator Backend") as demo:
|
| 12 |
+
gr.Markdown("# OMR Comparator Backend")
|
| 13 |
+
gr.Markdown("Gateway health check for the OMR Bench application.")
|
| 14 |
+
check = gr.Button("Check ZeroGPU")
|
| 15 |
+
output = gr.Textbox(label="Status")
|
| 16 |
+
check.click(fn=zero_gpu_ready, inputs=[], outputs=output, api_name="zero_gpu_ready")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
app = gr.mount_gradio_app(fastapi_app, demo, path="/")
|