fffiloni commited on
Commit
6c305c0
1 Parent(s): e912c2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  from gradio_client import Client
3
- import traceback
4
 
5
  def get_speech(text, voice):
6
  client = Client("https://collabora-whisperspeech.hf.space/")
@@ -31,10 +30,9 @@ def pipe (text, voice, image_in):
31
 
32
  try:
33
  video = get_dreamtalk(image_in, speech)
34
- except Exception as e:
35
- tb = traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
36
- print("".join(tb))
37
- raise gr.Error('An error occurred while loading DreamTalk:\n{}'.format('\n'.join(tb))) from None
38
 
39
  return video
40
 
 
1
  import gradio as gr
2
  from gradio_client import Client
 
3
 
4
  def get_speech(text, voice):
5
  client = Client("https://collabora-whisperspeech.hf.space/")
 
30
 
31
  try:
32
  video = get_dreamtalk(image_in, speech)
33
+ except:
34
+
35
+ raise gr.Error('An error occurred while loading DreamTalk: Image may not contain any face')
 
36
 
37
  return video
38