Spaces:
Sleeping
Sleeping
Update Summarization/main.py
Browse files- Summarization/main.py +4 -0
Summarization/main.py
CHANGED
@@ -44,6 +44,10 @@ async def caption(file: UploadFile = File(...)):
|
|
44 |
return JSONResponse({"error": str(e)}, status_code=500)
|
45 |
|
46 |
@app.get("/files/{filename}")
|
|
|
|
|
|
|
|
|
47 |
async def serve_file(filename: str):
|
48 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
49 |
|
|
|
44 |
return JSONResponse({"error": str(e)}, status_code=500)
|
45 |
|
46 |
@app.get("/files/{filename}")
|
47 |
+
async def serve_file(filename: str):
|
48 |
+
filepath = os.path.join(tempfile.gettempdir(), filename)
|
49 |
+
if filename.endswith('.mp3'):
|
50 |
+
return FileResponse(filepath, media_type="audio/mpeg")
|
51 |
async def serve_file(filename: str):
|
52 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
53 |
|