Spaces:
Runtime error
Runtime error
Commit
·
8604a93
1
Parent(s):
6f6920c
shared webhook data
Browse files
app.py
CHANGED
@@ -3,7 +3,10 @@ from huggingface_hub import WebhooksServer, WebhookPayload
|
|
3 |
|
4 |
from model import model
|
5 |
|
|
|
|
|
6 |
with gr.Blocks() as ui:
|
|
|
7 |
progress = gr.Progress(track_tqdm=True)
|
8 |
|
9 |
# 2. Create WebhooksServer with custom UI and secret
|
@@ -11,6 +14,7 @@ app = WebhooksServer(ui=ui, webhook_secret="test")
|
|
11 |
|
12 |
@app.add_webhook
|
13 |
async def train(payload: WebhookPayload):
|
|
|
14 |
print("Received payload:", payload.dict())
|
15 |
return payload.dict()
|
16 |
|
|
|
3 |
|
4 |
from model import model
|
5 |
|
6 |
+
webhook_payload = None
|
7 |
+
|
8 |
with gr.Blocks() as ui:
|
9 |
+
gr.Markdown(f"## Hugging Face Webhooks Demo\n\n{webhook_payload.json()}")
|
10 |
progress = gr.Progress(track_tqdm=True)
|
11 |
|
12 |
# 2. Create WebhooksServer with custom UI and secret
|
|
|
14 |
|
15 |
@app.add_webhook
|
16 |
async def train(payload: WebhookPayload):
|
17 |
+
webhook_payload = payload
|
18 |
print("Received payload:", payload.dict())
|
19 |
return payload.dict()
|
20 |
|