Spaces:
Runtime error
Runtime error
Commit ·
afd885c
1
Parent(s): 4603dd2
Update server.py
Browse files
server.py
CHANGED
|
@@ -48,15 +48,15 @@ def delete_old_files():
|
|
| 48 |
print(filename)
|
| 49 |
os.remove(os.path.join(path, filename))
|
| 50 |
|
| 51 |
-
@app.on_event("startup")
|
| 52 |
-
def startup_event(background_tasks: BackgroundTasks):
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
|
| 61 |
@app.get("/")
|
| 62 |
async def root():
|
|
@@ -65,7 +65,7 @@ async def root():
|
|
| 65 |
return response
|
| 66 |
|
| 67 |
@app.post("/cardtagger")
|
| 68 |
-
async def resolution(request
|
| 69 |
|
| 70 |
authorization_token = request.headers.get("Authorization", None)
|
| 71 |
|
|
|
|
| 48 |
print(filename)
|
| 49 |
os.remove(os.path.join(path, filename))
|
| 50 |
|
| 51 |
+
# @app.on_event("startup")
|
| 52 |
+
# def startup_event(background_tasks: BackgroundTasks):
|
| 53 |
+
# '''
|
| 54 |
+
# Create out dir
|
| 55 |
+
# '''
|
| 56 |
+
# if not os.path.exists("/tmp"):
|
| 57 |
+
# os.makedirs("/tmp")
|
| 58 |
+
#
|
| 59 |
+
# background_tasks.add_task(check_gpu_usage)
|
| 60 |
|
| 61 |
@app.get("/")
|
| 62 |
async def root():
|
|
|
|
| 65 |
return response
|
| 66 |
|
| 67 |
@app.post("/cardtagger")
|
| 68 |
+
async def resolution(request: Request, background_tasks: BackgroundTasks, response: Response, data: UploadFile = Form(...)):
|
| 69 |
|
| 70 |
authorization_token = request.headers.get("Authorization", None)
|
| 71 |
|