Update xtts_train.py
Browse files- xtts_train.py +6 -0
xtts_train.py
CHANGED
|
@@ -44,6 +44,12 @@ def run_tts(lang, tts_text, speaker_audio_file):
|
|
| 44 |
if XTTS_MODEL is None or not speaker_audio_file:
|
| 45 |
return "You need to run the previous step to load the model !!", None, None
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
gpt_cond_latent, speaker_embedding = XTTS_MODEL.get_conditioning_latents(audio_path=speaker_audio_file, gpt_cond_len=XTTS_MODEL.config.gpt_cond_len, max_ref_length=XTTS_MODEL.config.max_ref_len, sound_norm_refs=XTTS_MODEL.config.sound_norm_refs)
|
| 48 |
out = XTTS_MODEL.inference(
|
| 49 |
text=tts_text,
|
|
|
|
| 44 |
if XTTS_MODEL is None or not speaker_audio_file:
|
| 45 |
return "You need to run the previous step to load the model !!", None, None
|
| 46 |
|
| 47 |
+
# Access the list element
|
| 48 |
+
speaker_audio_file = speaker_audio_file[0]
|
| 49 |
+
|
| 50 |
+
# Remove brackets and quotes
|
| 51 |
+
speaker_audio_file = speaker_audio_file.replace("[", "").replace("]", "").replace("'", "")
|
| 52 |
+
|
| 53 |
gpt_cond_latent, speaker_embedding = XTTS_MODEL.get_conditioning_latents(audio_path=speaker_audio_file, gpt_cond_len=XTTS_MODEL.config.gpt_cond_len, max_ref_length=XTTS_MODEL.config.max_ref_len, sound_norm_refs=XTTS_MODEL.config.sound_norm_refs)
|
| 54 |
out = XTTS_MODEL.inference(
|
| 55 |
text=tts_text,
|