Update app.py
Browse files
app.py
CHANGED
@@ -72,6 +72,16 @@ hinglish_labels = ['not toxic', 'toxic']
|
|
72 |
# FastAPI
|
73 |
app = FastAPI()
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
class TextIn(BaseModel):
|
77 |
text: str
|
|
|
72 |
# FastAPI
|
73 |
app = FastAPI()
|
74 |
|
75 |
+
from fastapi.middleware.cors import CORSMiddleware
|
76 |
+
|
77 |
+
app.add_middleware(
|
78 |
+
CORSMiddleware,
|
79 |
+
allow_origins=["*"], # Or restrict to your frontend domain
|
80 |
+
allow_credentials=True,
|
81 |
+
allow_methods=["*"],
|
82 |
+
allow_headers=["*"],
|
83 |
+
)
|
84 |
+
|
85 |
|
86 |
class TextIn(BaseModel):
|
87 |
text: str
|