Spaces:
Sleeping
Sleeping
Removed cross-origin requests allowance as it did not work
Browse files- src/main.py +0 -10
src/main.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
from contextlib import asynccontextmanager
|
2 |
from fastapi import FastAPI
|
3 |
-
from fastapi.middleware.cors import CORSMiddleware
|
4 |
from transformers import (
|
5 |
AutoImageProcessor,
|
6 |
AutoModel,
|
@@ -39,15 +38,6 @@ app = FastAPI(
|
|
39 |
description="Mushrooms Classification API", version="0.1.0", lifespan=lifespan
|
40 |
)
|
41 |
|
42 |
-
# Allow all origins for CORS (can be restricted to specific address)
|
43 |
-
app.add_middleware(
|
44 |
-
CORSMiddleware,
|
45 |
-
allow_origins=["*"],
|
46 |
-
allow_credentials=True,
|
47 |
-
allow_methods=["*"],
|
48 |
-
allow_headers=["*"],
|
49 |
-
)
|
50 |
-
|
51 |
|
52 |
@app.get("/")
|
53 |
async def root():
|
|
|
1 |
from contextlib import asynccontextmanager
|
2 |
from fastapi import FastAPI
|
|
|
3 |
from transformers import (
|
4 |
AutoImageProcessor,
|
5 |
AutoModel,
|
|
|
38 |
description="Mushrooms Classification API", version="0.1.0", lifespan=lifespan
|
39 |
)
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
@app.get("/")
|
43 |
async def root():
|