gorkemgoknar commited on
Commit
6550ebd
1 Parent(s): 4e13633

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -198,10 +198,15 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_clea
198
  try:
199
  gpt_cond_latent, diffusion_conditioning, speaker_embedding = model.get_conditioning_latents(audio_path=speaker_wav)
200
  except Exception as e:
201
- if "Failed to decode" in str(e):
202
- print("Speaker encoding error", str(e))
203
- gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
204
-
 
 
 
 
 
205
 
206
  latent_calculation_time = time.time() - t_latent
207
  #metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"
 
198
  try:
199
  gpt_cond_latent, diffusion_conditioning, speaker_embedding = model.get_conditioning_latents(audio_path=speaker_wav)
200
  except Exception as e:
201
+ print("Speaker encoding error", str(e))
202
+ gr.Warning("It appears something wrong with reference, did you unmute your microphone?")
203
+ return (
204
+ None,
205
+ None,
206
+ None,
207
+ None,
208
+ )
209
+
210
 
211
  latent_calculation_time = time.time() - t_latent
212
  #metrics_text=f"Embedding calculation time: {latent_calculation_time:.2f} seconds\n"