koyu008 commited on
Commit
f3eb85c
·
verified ·
1 Parent(s): 7128733

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
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