Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,19 +8,19 @@ import sounddevice as sd
|
|
| 8 |
from scipy.io.wavfile import write
|
| 9 |
import tempfile
|
| 10 |
import os
|
| 11 |
-
import uvicorn
|
| 12 |
|
| 13 |
# Initialize FastAPI app
|
| 14 |
app = FastAPI()
|
| 15 |
|
| 16 |
# CORS configuration
|
| 17 |
-
app.add_middleware(
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
|
| 25 |
# Initialize TTS engine for speaking the translated text
|
| 26 |
engine = pyttsx3.init()
|
|
|
|
| 8 |
from scipy.io.wavfile import write
|
| 9 |
import tempfile
|
| 10 |
import os
|
| 11 |
+
# import uvicorn
|
| 12 |
|
| 13 |
# Initialize FastAPI app
|
| 14 |
app = FastAPI()
|
| 15 |
|
| 16 |
# CORS configuration
|
| 17 |
+
# app.add_middleware(
|
| 18 |
+
# CORSMiddleware,
|
| 19 |
+
# allow_origins=["*"], # Allow all origins for development; adjust for production
|
| 20 |
+
# allow_credentials=True,
|
| 21 |
+
# allow_methods=["*"], # Allow all HTTP methods
|
| 22 |
+
# allow_headers=["*"], # Allow all headers
|
| 23 |
+
# )
|
| 24 |
|
| 25 |
# Initialize TTS engine for speaking the translated text
|
| 26 |
engine = pyttsx3.init()
|