gorkemgoknar commited on
Commit
285150b
1 Parent(s): 5680d64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -38,10 +38,14 @@ print("Make ffmpeg binary executable")
38
  st = os.stat('ffmpeg')
39
  os.chmod('ffmpeg', st.st_mode | stat.S_IEXEC)
40
 
41
- # Load TTS
42
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1.1")
 
 
 
 
 
43
 
44
- model_path = os.path.join(get_user_data_dir("tts"), "tts_models--multilingual--multi-dataset--xtts_v1.1")
45
  config = XttsConfig()
46
  config.load_json(os.path.join(model_path, "config.json"))
47
 
 
38
  st = os.stat('ffmpeg')
39
  os.chmod('ffmpeg', st.st_mode | stat.S_IEXEC)
40
 
41
+ # This will trigger downloading model
42
+ print("Downloading if not downloaded Coqui XTTS V1.1")
43
+ from TTS.utils.manage import ModelManager
44
+ model_name = "tts_models/multilingual/multi-dataset/xtts_v1.1"
45
+ ModelManager().download_model(model_name)
46
+ model_path = os.path.join(get_user_data_dir("tts"), model_name.replace("/", "--"))
47
+ print("XTTS downloaded")
48
 
 
49
  config = XttsConfig()
50
  config.load_json(os.path.join(model_path, "config.json"))
51