Spaces:
Running
Running
Update Summarization/main.py
Browse files- Summarization/main.py +1 -6
Summarization/main.py
CHANGED
@@ -41,14 +41,9 @@ async def caption(file: UploadFile = File(...)):
|
|
41 |
except Exception as e:
|
42 |
return JSONResponse({"error": str(e)}, status_code=500)
|
43 |
|
44 |
-
@app.get("/files/{filename}")
|
45 |
async def serve_file(filename: str):
|
46 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
47 |
-
altpath = os.path.join(tempfile.gettempdir(), "aidan_files", filename)
|
48 |
-
|
49 |
if os.path.exists(filepath):
|
50 |
return FileResponse(filepath)
|
51 |
-
elif os.path.exists(altpath):
|
52 |
-
return FileResponse(altpath)
|
53 |
-
|
54 |
return JSONResponse({"error": "File not found"}, status_code=404)
|
|
|
41 |
except Exception as e:
|
42 |
return JSONResponse({"error": str(e)}, status_code=500)
|
43 |
|
44 |
+
@app.get("/files/{filename}")
|
45 |
async def serve_file(filename: str):
|
46 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
|
|
|
|
47 |
if os.path.exists(filepath):
|
48 |
return FileResponse(filepath)
|
|
|
|
|
|
|
49 |
return JSONResponse({"error": "File not found"}, status_code=404)
|