yukee1992 commited on
Commit
6fd1d9c
ยท
verified ยท
1 Parent(s): 67a4f22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -63,7 +63,14 @@ try:
63
  try:
64
  print("๐Ÿš€ Loading XTTS model...")
65
 
66
- # Try to load XTTS model
 
 
 
 
 
 
 
67
  tts = TTS(DEFAULT_MODEL).to(DEVICE)
68
  model_loaded = True
69
  current_model = DEFAULT_MODEL
 
63
  try:
64
  print("๐Ÿš€ Loading XTTS model...")
65
 
66
+ # Clear any potentially corrupted model files
67
+ model_path = os.path.expanduser("~/.local/share/tts/tts_models--multilingual--multi-dataset--xtts_v2")
68
+ if os.path.exists(model_path):
69
+ print(f"๐Ÿ”„ Clearing potentially corrupted model cache: {model_path}")
70
+ import shutil
71
+ shutil.rmtree(model_path, ignore_errors=True)
72
+
73
+ # Try to load XTTS model with explicit download
74
  tts = TTS(DEFAULT_MODEL).to(DEVICE)
75
  model_loaded = True
76
  current_model = DEFAULT_MODEL