Update app/main.py
Browse files- app/main.py +21 -18
app/main.py
CHANGED
|
@@ -1,18 +1,21 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
-
from app.routes import summarize
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
+
from app.routes import summarize
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
os.environ['TRANSFORMERS_CACHE'] = '/tmp/hf_cache'
|
| 7 |
+
|
| 8 |
+
app = FastAPI()
|
| 9 |
+
|
| 10 |
+
app.add_middleware(
|
| 11 |
+
CORSMiddleware,
|
| 12 |
+
allow_origins=["*"],
|
| 13 |
+
allow_methods=["*"],
|
| 14 |
+
allow_headers=["*"],
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
@app.get("/")
|
| 18 |
+
def read_root():
|
| 19 |
+
return {"message": "AutoTLDR backend is running"}
|
| 20 |
+
|
| 21 |
+
app.include_router(summarize.router)
|