Spaces:
Build error
Build error
Kartikeyssj2
commited on
Commit
•
5f4c2ef
1
Parent(s):
d3c1426
changes
Browse files
main.py
CHANGED
@@ -20,6 +20,15 @@ app = FastAPI()
|
|
20 |
tokenizer = Wav2Vec2Tokenizer.from_pretrained("./models/tokenizer")
|
21 |
model = Wav2Vec2ForCTC.from_pretrained("./models/model")
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
# Function to download English word list
|
25 |
def download_word_list():
|
|
|
20 |
tokenizer = Wav2Vec2Tokenizer.from_pretrained("./models/tokenizer")
|
21 |
model = Wav2Vec2ForCTC.from_pretrained("./models/model")
|
22 |
|
23 |
+
from fastapi.middleware.cors import CORSMiddleware
|
24 |
+
|
25 |
+
app.add_middleware(
|
26 |
+
CORSMiddleware,
|
27 |
+
allow_origins=["*"], # Allows all origins
|
28 |
+
allow_credentials=True,
|
29 |
+
allow_methods=["*"], # Allows all methods
|
30 |
+
allow_headers=["*"], # Allows all headers
|
31 |
+
)
|
32 |
|
33 |
# Function to download English word list
|
34 |
def download_word_list():
|