Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -1,16 +1,11 @@
|
|
| 1 |
-
from
|
| 2 |
|
| 3 |
-
from
|
| 4 |
|
| 5 |
-
app = FastAPI()
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
@app.get("/")
|
| 9 |
-
def read_root():
|
| 10 |
-
return {"Hello": "World"}
|
| 11 |
|
| 12 |
-
|
| 13 |
-
@app.get("/items/{item_id}")
|
| 14 |
-
def read_item(item_id: int, q: Union[str, None] = None):
|
| 15 |
-
return {"item_id": item_id, "q": q}
|
| 16 |
-
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
|
| 3 |
+
from huggingface_hub import webhook_endpoint, WebhookPayload
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
+
@webhook_endpoint
|
| 7 |
+
async def trigger_training(payload: WebhookPayload):
|
| 8 |
+
print("Triggering training job")
|
| 9 |
+
return {"message": "done running training job"}
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|