Salman11223 commited on
Commit
4132cff
·
verified ·
1 Parent(s): 04481d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -10,15 +10,14 @@ from TTS.tts.configs.xtts_config import XttsConfig
10
  from TTS.tts.models.xtts import Xtts
11
 
12
  # Define paths for model and configuration files
13
- model_path = "/xtts_v2"
14
- config_path = os.path.join(model_path, "/config.json")
15
- checkpoint_path = model_path
16
 
17
  # Initialize and load the XTTS model
18
- config = XttsConfig()
19
- config.load_json(config_path)
20
  model = Xtts.init_from_config(config)
21
- model.load_checkpoint(config, checkpoint_dir=checkpoint_path, eval=True)
22
  model.cuda() # Move model to GPU if available
23
 
24
  def synthesize_text(text, speaker_wav, language):
 
10
  from TTS.tts.models.xtts import Xtts
11
 
12
  # Define paths for model and configuration files
13
+ # model_path = "/xtts_v2"
14
+ #config_path = os.path.join(model_path, "/config.json")
15
+ # checkpoint_path = model_path
16
 
17
  # Initialize and load the XTTS model
18
+ config = XttsConfig("/xtts_v2/config.json")
 
19
  model = Xtts.init_from_config(config)
20
+ model.load_checkpoint(config, checkpoint_dir="/xtts_v2", eval=True)
21
  model.cuda() # Move model to GPU if available
22
 
23
  def synthesize_text(text, speaker_wav, language):