mohayemin commited on
Commit
6ee2648
·
1 Parent(s): 59ef61f
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -1,16 +1,11 @@
1
- from typing import Union
2
 
3
- from fastapi import FastAPI
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