Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBERT-MCDOWELL committed Feb 19, 2025
1 parent 397b383 commit 860138a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/classes/tts_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, session):
self._build()

def _build(self):
self.params['curent_voice_path'] = None
self.params['current_voice_path'] = None
if self.session['tts_engine'] == XTTSv2:
if self.session['custom_model'] is not None:
self.model_name = os.path.basename(self.session['custom_model'])
Expand Down Expand Up @@ -169,16 +169,16 @@ def convert_sentence_to_audio(self):
'''
if self.session['tts_engine'] == XTTSv2:
if self.session['custom_model'] is not None or self.session['fine_tuned'] != 'internal':
msg = 'Computing speaker latents...'
print(msg)
self.params['voice_path'] = (
self.session['voice'] if self.session['voice'] is not None
else os.path.join(self.session['custom_model_dir'], self.session['tts_engine'], self.session['custom_model'],'ref.wav') if self.session['custom_model']
else models[self.session['tts_engine']][self.session['fine_tuned']]['voice'] if self.session['fine_tuned']
else models[self.session['tts_engine']]['internal']['voice']
)
if self.params['curent_voice_path'] != self.params['voice_path']:
self.params['curent_voice_path'] = self.params['voice_path']
if self.params['current_voice_path'] != self.params['voice_path']:
msg = 'Computing speaker latents...'
print(msg)
self.params['current_voice_path'] = self.params['voice_path']
self.params['gpt_cond_latent'], self.params['speaker_embedding'] = self.params['tts'].get_conditioning_latents(audio_path=[self.params['voice_path']])
with torch.no_grad():
result = self.params['tts'].inference(
Expand Down

0 comments on commit 860138a

Please sign in to comment.