Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,13 +52,17 @@ def predict(data: MachineData):
|
|
| 52 |
)
|
| 53 |
|
| 54 |
|
| 55 |
-
#
|
| 56 |
@spaces.GPU
|
| 57 |
def warmup():
|
| 58 |
-
return "
|
| 59 |
|
| 60 |
|
| 61 |
with gr.Blocks() as demo:
|
| 62 |
gr.Markdown("### Aegis CNC Predictive Maintenance API is Running\nUse `POST /predict` from the frontend.")
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
|
| 55 |
+
# Wired to a Gradio button so ZeroGPU detects @spaces.GPU during demo.launch()
|
| 56 |
@spaces.GPU
|
| 57 |
def warmup():
|
| 58 |
+
return "ZeroGPU Hook Active"
|
| 59 |
|
| 60 |
|
| 61 |
with gr.Blocks() as demo:
|
| 62 |
gr.Markdown("### Aegis CNC Predictive Maintenance API is Running\nUse `POST /predict` from the frontend.")
|
| 63 |
+
btn = gr.Button("Check ZeroGPU Hook")
|
| 64 |
+
out = gr.Textbox(label="Status")
|
| 65 |
+
btn.click(fn=warmup, outputs=out)
|
| 66 |
|
| 67 |
+
# demo.launch(app=api) triggers ZeroGPU's startup hook AND serves your FastAPI routes (/predict, /health)
|
| 68 |
+
demo.launch(app=api)
|