Spaces:
Runtime error
Runtime error
enabled CORS
Browse files
main.py
CHANGED
@@ -1,10 +1,20 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
|
|
2 |
from inference import outcome
|
3 |
import warnings
|
4 |
warnings.filterwarnings("ignore")
|
5 |
|
6 |
app=FastAPI()
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
@app.get('/')
|
9 |
def index():
|
10 |
return {"message":"Welcome to Hinglish Translator"}
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
3 |
+
|
4 |
from inference import outcome
|
5 |
import warnings
|
6 |
warnings.filterwarnings("ignore")
|
7 |
|
8 |
app=FastAPI()
|
9 |
|
10 |
+
app.add_middleware(
|
11 |
+
CORSMiddleware,
|
12 |
+
allow_origins=["*"],
|
13 |
+
allow_credentials=True,
|
14 |
+
allow_methods=["*"],
|
15 |
+
allow_headers=["*"],
|
16 |
+
)
|
17 |
+
|
18 |
@app.get('/')
|
19 |
def index():
|
20 |
return {"message":"Welcome to Hinglish Translator"}
|