NLPV commited on
Commit
40dde11
·
verified ·
1 Parent(s): 4e9d040

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -6,7 +6,13 @@ import soundfile as sf
6
  import warnings
7
  warnings.filterwarnings("ignore", category=FutureWarning)
8
  # This will delete cached model to force a clean download
9
- !rm -rf ~/.local/share/tts/tts_models--multilingual--multi-dataset--xtts_v2
 
 
 
 
 
 
10
 
11
 
12
  # ===== Step 1: Allowlist Required Classes for PyTorch >= 2.6 =====
 
6
  import warnings
7
  warnings.filterwarnings("ignore", category=FutureWarning)
8
  # This will delete cached model to force a clean download
9
+ import subprocess
10
+
11
+ # Clear cached XTTS model to force a fresh download (only needed once)
12
+ model_cache_path = os.path.expanduser("~/.local/share/tts/tts_models--multilingual--multi-dataset--xtts_v2")
13
+ if os.path.exists(model_cache_path):
14
+ subprocess.run(["rm", "-rf", model_cache_path], check=True)
15
+
16
 
17
 
18
  # ===== Step 1: Allowlist Required Classes for PyTorch >= 2.6 =====