lalalic commited on
Commit
ed36c72
·
verified ·
1 Parent(s): 01631c1

Update xtts.py

Browse files
Files changed (1) hide show
  1. xtts.py +3 -3
xtts.py CHANGED
@@ -69,20 +69,20 @@ def get_conditioning_latents(audio_path, **others):
69
  global model
70
  speaker_wav, pt_file=download_sample(audio_path)
71
  try:
72
- if pt_file != None:
73
  (
74
  gpt_cond_latent,
75
  speaker_embedding,
76
  ) = torch.load(pt_file)
77
  logging.debug(f'sample wav info loaded from {pt_file}')
78
  except:
79
- logging.debug(f'creating sample latent and embedding from {audio_path}')
80
  (
81
  gpt_cond_latent,
82
  speaker_embedding,
83
  ) = model.__get_conditioning_latents(audio_path=speaker_wav, **others)
84
  torch.save((gpt_cond_latent,speaker_embedding), pt_file)
85
- logging.debug(f'sample wav info saved to {pt_file}')
86
  return gpt_cond_latent,speaker_embedding
87
 
88
  def download_sample(url):
 
69
  global model
70
  speaker_wav, pt_file=download_sample(audio_path)
71
  try:
72
+ if pt_file != None and os.path.exists(pt_file):
73
  (
74
  gpt_cond_latent,
75
  speaker_embedding,
76
  ) = torch.load(pt_file)
77
  logging.debug(f'sample wav info loaded from {pt_file}')
78
  except:
79
+ logging.debug(f'creating sample latent and embedding from {speaker_wav}')
80
  (
81
  gpt_cond_latent,
82
  speaker_embedding,
83
  ) = model.__get_conditioning_latents(audio_path=speaker_wav, **others)
84
  torch.save((gpt_cond_latent,speaker_embedding), pt_file)
85
+ logging.debug(f'sample latent and embedding saved to {pt_file}')
86
  return gpt_cond_latent,speaker_embedding
87
 
88
  def download_sample(url):