Spaces:
Runtime error
Runtime error
Francisco Aranda
commited on
Commit
•
f40fa43
1
Parent(s):
16eaf19
run as uvicorn server
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🦀
|
|
4 |
colorFrom: pink
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.44
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
4 |
colorFrom: pink
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.44
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
app.py
CHANGED
@@ -17,6 +17,7 @@ for webhook in client.webhooks:
|
|
17 |
print(f"Deleting webhook: {webhook.url}")
|
18 |
webhook.delete()
|
19 |
|
|
|
20 |
# Create a webhook for record events
|
21 |
@rg.webhook_listener(events=["record.created", "record.updated", "record.deleted", "record.completed"])
|
22 |
async def record_events(record: rg.Record, type: str, timestamp: datetime):
|
@@ -56,4 +57,7 @@ with gr.Blocks() as demo:
|
|
56 |
|
57 |
gr.mount_gradio_app(server, demo, path="/")
|
58 |
|
59 |
-
|
|
|
|
|
|
|
|
17 |
print(f"Deleting webhook: {webhook.url}")
|
18 |
webhook.delete()
|
19 |
|
20 |
+
|
21 |
# Create a webhook for record events
|
22 |
@rg.webhook_listener(events=["record.created", "record.updated", "record.deleted", "record.completed"])
|
23 |
async def record_events(record: rg.Record, type: str, timestamp: datetime):
|
|
|
57 |
|
58 |
gr.mount_gradio_app(server, demo, path="/")
|
59 |
|
60 |
+
# Start the FastAPI server
|
61 |
+
import uvicorn
|
62 |
+
|
63 |
+
uvicorn.run(server, host="0.0.0.0", port=7860)
|