gnosticdev commited on
Commit
ebafac2
·
verified ·
1 Parent(s): ea2109c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -187,7 +187,7 @@ def text_to_speech(text, output_path, voice=None):
187
  return False
188
 
189
  try:
190
- # Usar un modelo ligero y confirmado Ascoltado para español
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, language="es")
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: