gorkemgoknar commited on
Commit
d9dc2f9
1 Parent(s): 8a37abb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -53,15 +53,12 @@ from huggingface_hub import InferenceClient
53
 
54
  # This will trigger downloading model
55
  print("Downloading if not downloaded Coqui XTTS V1.1")
56
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1.1")
57
- del tts
 
 
58
  print("XTTS downloaded")
59
 
60
- print("Loading XTTS")
61
- # Below will use model directly for inference
62
- model_path = os.path.join(
63
- get_user_data_dir("tts"), "tts_models--multilingual--multi-dataset--xtts_v1.1"
64
- )
65
  config = XttsConfig()
66
  config.load_json(os.path.join(model_path, "config.json"))
67
 
 
53
 
54
  # This will trigger downloading model
55
  print("Downloading if not downloaded Coqui XTTS V1.1")
56
+ from TTS.utils.manage import ModelManager
57
+ model_name = "tts_models/multilingual/multi-dataset/xtts_v1.1"
58
+ ModelManager().download_model(model_name)
59
+ model_path = os.path.join(get_user_data_dir("tts"), model_name.replace("/", "--"))
60
  print("XTTS downloaded")
61
 
 
 
 
 
 
62
  config = XttsConfig()
63
  config.load_json(os.path.join(model_path, "config.json"))
64