Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
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):
|