Spaces:
Running
Running
Update Summarization/main.py
Browse files- Summarization/main.py +2 -9
Summarization/main.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
from fastapi.responses import HTMLResponse, JSONResponse, FileResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
from fastapi.templating import Jinja2Templates
|
@@ -53,11 +53,4 @@ async def serve_file(filename: str):
|
|
53 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
54 |
if os.path.exists(filepath):
|
55 |
return FileResponse(filepath)
|
56 |
-
return JSONResponse({"error": "File not found"}, status_code=404)
|
57 |
-
from fastapi import FastAPI
|
58 |
-
|
59 |
-
app = FastAPI()
|
60 |
-
|
61 |
-
@app.get("/", tags=["Summarization"])
|
62 |
-
async def root():
|
63 |
-
return {"message": "Welcome to Summarization Service!"}
|
|
|
1 |
+
from fastapi import FastAPI, UploadFile, File, Form, Request
|
2 |
from fastapi.responses import HTMLResponse, JSONResponse, FileResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
from fastapi.templating import Jinja2Templates
|
|
|
53 |
filepath = os.path.join(tempfile.gettempdir(), filename)
|
54 |
if os.path.exists(filepath):
|
55 |
return FileResponse(filepath)
|
56 |
+
return JSONResponse({"error": "File not found"}, status_code=404)
|
|
|
|
|
|
|
|
|
|
|
|
|
|