Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -187,7 +187,7 @@ def text_to_speech(text, output_path, voice=None):
|
|
187 |
return False
|
188 |
|
189 |
try:
|
190 |
-
# Usar
|
191 |
tts = TTS(model_name="tts_models/es/css10/vits", progress_bar=False, gpu=False)
|
192 |
|
193 |
# Limpiar y truncar texto
|
@@ -196,8 +196,8 @@ def text_to_speech(text, output_path, voice=None):
|
|
196 |
logger.warning("Texto demasiado largo, truncando a 500 caracteres")
|
197 |
text = text[:500]
|
198 |
|
199 |
-
# Generar audio
|
200 |
-
tts.tts_to_file(text=text, file_path=output_path
|
201 |
|
202 |
# Verificar archivo generado
|
203 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 1000:
|
|
|
187 |
return False
|
188 |
|
189 |
try:
|
190 |
+
# Usar modelo específico para español, sin GPU
|
191 |
tts = TTS(model_name="tts_models/es/css10/vits", progress_bar=False, gpu=False)
|
192 |
|
193 |
# Limpiar y truncar texto
|
|
|
196 |
logger.warning("Texto demasiado largo, truncando a 500 caracteres")
|
197 |
text = text[:500]
|
198 |
|
199 |
+
# Generar audio sin especificar idioma
|
200 |
+
tts.tts_to_file(text=text, file_path=output_path)
|
201 |
|
202 |
# Verificar archivo generado
|
203 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 1000:
|