Spaces:
Sleeping
Sleeping
Ezi Ozoani
commited on
Commit
·
f55800a
1
Parent(s):
a24d7bf
updating config file
Browse files
main.py
CHANGED
@@ -5,7 +5,7 @@ import requests
|
|
5 |
from fastapi import BackgroundTasks, FastAPI, Header, HTTPException
|
6 |
from fastapi.responses import FileResponse
|
7 |
from huggingface_hub.hf_api import HfApi
|
8 |
-
from models import WebhookPayload
|
9 |
|
10 |
from fastapi import FastAPI, Request, Response
|
11 |
from huggingface_hub import (DatasetCard, HfApi, ModelCard, comment_discussion,
|
@@ -29,7 +29,7 @@ async def post_webhook(
|
|
29 |
if not (
|
30 |
payload.event.action == "update"
|
31 |
and payload.event.scope.startswith("repo.content")
|
32 |
-
and payload.repo.name ==
|
33 |
and payload.repo.type == "dataset"
|
34 |
):
|
35 |
# no-op if the payload does not match our expectations
|
|
|
5 |
from fastapi import BackgroundTasks, FastAPI, Header, HTTPException
|
6 |
from fastapi.responses import FileResponse
|
7 |
from huggingface_hub.hf_api import HfApi
|
8 |
+
from models import WebhookPayload
|
9 |
|
10 |
from fastapi import FastAPI, Request, Response
|
11 |
from huggingface_hub import (DatasetCard, HfApi, ModelCard, comment_discussion,
|
|
|
29 |
if not (
|
30 |
payload.event.action == "update"
|
31 |
and payload.event.scope.startswith("repo.content")
|
32 |
+
and payload.repo.name == "Ezi/test_PII"
|
33 |
and payload.repo.type == "dataset"
|
34 |
):
|
35 |
# no-op if the payload does not match our expectations
|
models.py
CHANGED
@@ -14,7 +14,7 @@ class WebhookPayloadEvent(BaseModel):
|
|
14 |
scope: str
|
15 |
|
16 |
class WebhookPayloadRepo(BaseModel):
|
17 |
-
type: Literal["dataset"
|
18 |
name: str
|
19 |
id: str
|
20 |
private: bool
|
@@ -25,4 +25,4 @@ class WebhookPayload(BaseModel):
|
|
25 |
repo: WebhookPayloadRepo
|
26 |
|
27 |
|
28 |
-
config = Config.parse_file(os.path.join(os.getcwd(), "config.json"))
|
|
|
14 |
scope: str
|
15 |
|
16 |
class WebhookPayloadRepo(BaseModel):
|
17 |
+
type: Literal["dataset"]
|
18 |
name: str
|
19 |
id: str
|
20 |
private: bool
|
|
|
25 |
repo: WebhookPayloadRepo
|
26 |
|
27 |
|
28 |
+
#config = Config.parse_file(os.path.join(os.getcwd(), "config.json"))
|