Spaces:
Sleeping
Sleeping
Commit ·
5e1f939
1
Parent(s): 41d63c9
Fix auto-refresh timer in Gradio app
Browse filesReplace deprecated every parameter on demo.load with gr.Timer component for auto-refresh functionality.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -198,8 +198,12 @@ with gr.Blocks(title="HuggingFace Webhook Processor") as demo:
|
|
| 198 |
outputs=[recent_messages]
|
| 199 |
)
|
| 200 |
|
| 201 |
-
# Auto-refresh every 5 seconds
|
| 202 |
-
demo.load(get_status, outputs=[status_text, message_count, batch_count, latest_batch]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
|
| 205 |
# Add webhook endpoint to FastAPI
|
|
|
|
| 198 |
outputs=[recent_messages]
|
| 199 |
)
|
| 200 |
|
| 201 |
+
# Auto-refresh status every 5 seconds
|
| 202 |
+
demo.load(fn=get_status, outputs=[status_text, message_count, batch_count, latest_batch])
|
| 203 |
+
|
| 204 |
+
# Create a timer for auto-refresh
|
| 205 |
+
timer = gr.Timer(5)
|
| 206 |
+
timer.tick(fn=get_status, outputs=[status_text, message_count, batch_count, latest_batch])
|
| 207 |
|
| 208 |
|
| 209 |
# Add webhook endpoint to FastAPI
|