Spaces:
Running
Running
JuanHernandez-uc commited on
Commit ·
6ed0dab
1
Parent(s): ee647d2
fix app.py
Browse files
app.py
CHANGED
|
@@ -308,19 +308,12 @@ def analyze_image(pil_img: Image.Image) -> Dict[str, Any]:
|
|
| 308 |
# -----------------------
|
| 309 |
app = FastAPI(title="ViT Explainer API", version="1.0")
|
| 310 |
|
| 311 |
-
origins = [
|
| 312 |
-
"http://localhost:5173",
|
| 313 |
-
"http://127.0.0.1:5173",
|
| 314 |
-
"https://vit-explainer.vercel.app"
|
| 315 |
-
]
|
| 316 |
-
|
| 317 |
app.add_middleware(
|
| 318 |
CORSMiddleware,
|
| 319 |
-
allow_origins=
|
| 320 |
-
allow_credentials=
|
| 321 |
allow_methods=["*"],
|
| 322 |
allow_headers=["*"],
|
| 323 |
-
max_age=86400,
|
| 324 |
)
|
| 325 |
|
| 326 |
# In-memory store for "file-like endpoints" (job-based)
|
|
|
|
| 308 |
# -----------------------
|
| 309 |
app = FastAPI(title="ViT Explainer API", version="1.0")
|
| 310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
app.add_middleware(
|
| 312 |
CORSMiddleware,
|
| 313 |
+
allow_origins=["*"], # tighten in prod
|
| 314 |
+
allow_credentials=True,
|
| 315 |
allow_methods=["*"],
|
| 316 |
allow_headers=["*"],
|
|
|
|
| 317 |
)
|
| 318 |
|
| 319 |
# In-memory store for "file-like endpoints" (job-based)
|