Refactor TTS loading logic for lazy loading and error handling
Browse files- kitt/core/tts.py +1 -1
kitt/core/tts.py
CHANGED
@@ -110,7 +110,7 @@ def run_melo_tts(text: str, voice: str):
|
|
110 |
except ImportError as e:
|
111 |
logger.error(f"Error loading MeloTTS: {e}")
|
112 |
melo_tts = None
|
113 |
-
|
114 |
|
115 |
speed = 1.0
|
116 |
speaker_ids = melo_tts.hps.data.spk2id
|
|
|
110 |
except ImportError as e:
|
111 |
logger.error(f"Error loading MeloTTS: {e}")
|
112 |
melo_tts = None
|
113 |
+
raise ValueError("MeloTTS not available.")
|
114 |
|
115 |
speed = 1.0
|
116 |
speaker_ids = melo_tts.hps.data.spk2id
|