Update app.py
Browse files
app.py
CHANGED
@@ -63,8 +63,9 @@ async def generate_tts(tts_request: TTSRequest):
|
|
63 |
raise HTTPException(status_code=400, detail="Invalid speaker selected.")
|
64 |
|
65 |
# Initialize the model
|
|
|
66 |
try:
|
67 |
-
model =
|
68 |
except Exception as e:
|
69 |
raise HTTPException(status_code=500, detail=f"Error initializing TTS model: {e}")
|
70 |
|
|
|
63 |
raise HTTPException(status_code=400, detail="Invalid speaker selected.")
|
64 |
|
65 |
# Initialize the model
|
66 |
+
from melo.api import TTS
|
67 |
try:
|
68 |
+
model = TTS(language=language_code, device=device)
|
69 |
except Exception as e:
|
70 |
raise HTTPException(status_code=500, detail=f"Error initializing TTS model: {e}")
|
71 |
|