Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,13 @@ from huggingface_hub import webhook_endpoint, WebhookPayload
|
|
16 |
from fastapi import Request
|
17 |
import datetime
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
current_directory = os.path.dirname(os.path.abspath(__file__))
|
20 |
# Path to the config.json file
|
21 |
config_file_path = os.path.join(current_directory, "config.json")
|
@@ -56,6 +63,10 @@ async def update_streams(request: Request):
|
|
56 |
# Read the request body as JSON
|
57 |
payload = await request.json()
|
58 |
|
|
|
|
|
|
|
|
|
59 |
# Check if the payload structure matches the expected format
|
60 |
if "event" in payload and "data" in payload["event"]:
|
61 |
event_data = payload["event"]["data"]
|
|
|
16 |
from fastapi import Request
|
17 |
import datetime
|
18 |
|
19 |
+
curl -X POST -H "Content-Type: application/json" \
|
20 |
+
-d '{"payload": {"stream": {"name": "2B_100_batch"}}}' \
|
21 |
+
https://serjd-recode-hf-tripgeneration.hf.space/webhooks/update_streams
|
22 |
+
|
23 |
+
#https://serjd-recode_hf_tripGeneration.hf.space/webhooks/update_streams
|
24 |
+
#https://serjd-syncspeckle2notion.hf.space/webhooks/update_streams
|
25 |
+
|
26 |
current_directory = os.path.dirname(os.path.abspath(__file__))
|
27 |
# Path to the config.json file
|
28 |
config_file_path = os.path.join(current_directory, "config.json")
|
|
|
63 |
# Read the request body as JSON
|
64 |
payload = await request.json()
|
65 |
|
66 |
+
print("============= payload =============")
|
67 |
+
print(payload)
|
68 |
+
print("============= payload =============")
|
69 |
+
|
70 |
# Check if the payload structure matches the expected format
|
71 |
if "event" in payload and "data" in payload["event"]:
|
72 |
event_data = payload["event"]["data"]
|