yukee1992 commited on
Commit
d83addc
Β·
verified Β·
1 Parent(s): d855377

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -204,18 +204,31 @@ def load_tts_model(voice_style="default_female"):
204
 
205
  print(f"πŸš€ Loading {selected_model['description']}...")
206
 
 
 
207
  tts = TTS(selected_model["name"]).to(DEVICE)
208
 
209
- # Quick test
210
- tts.tts_to_file(text="Hello", file_path="/tmp/test.wav")
 
 
 
 
 
 
211
 
212
  model_loaded = True
213
  current_model = selected_model["name"]
214
  voice_cloning_supported = supports_voice_cloning()
 
 
 
215
  return True
216
 
217
  except Exception as e:
218
  print(f"❌ Failed to initialize TTS: {e}")
 
 
219
  model_loading = False
220
  return False
221
  finally:
 
204
 
205
  print(f"πŸš€ Loading {selected_model['description']}...")
206
 
207
+ # Initialize TTS with progress updates
208
+ print(f"πŸ“₯ Downloading model: {selected_model['name']}")
209
  tts = TTS(selected_model["name"]).to(DEVICE)
210
 
211
+ # Quick test with simple text
212
+ print("πŸ§ͺ Testing TTS with sample text...")
213
+ test_path = "/tmp/test.wav"
214
+ tts.tts_to_file(text="Hello", file_path=test_path)
215
+
216
+ # Clean up test file
217
+ if os.path.exists(test_path):
218
+ os.remove(test_path)
219
 
220
  model_loaded = True
221
  current_model = selected_model["name"]
222
  voice_cloning_supported = supports_voice_cloning()
223
+
224
+ print(f"βœ… Model loaded successfully: {current_model}")
225
+ print(f"πŸŽ™οΈ Voice cloning supported: {voice_cloning_supported}")
226
  return True
227
 
228
  except Exception as e:
229
  print(f"❌ Failed to initialize TTS: {e}")
230
+ import traceback
231
+ traceback.print_exc()
232
  model_loading = False
233
  return False
234
  finally: