Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import subprocess
|
|
8 |
import gradio as gr
|
9 |
import translators as ts
|
10 |
from gradio_client import Client
|
11 |
-
from
|
12 |
from list_dict import translates, speakers
|
13 |
|
14 |
if not os.path.exists('pretrained_models'):
|
@@ -133,7 +133,7 @@ def video_inputs(video, TR_LANGUAGE, LANGUAGE, SPEAKER):
|
|
133 |
ts_text = translator(result, TR_LANGUAGE, LANGUAGE)
|
134 |
except ffmpy.FFRuntimeError:
|
135 |
raise gr.Error('Mismatched audio!')
|
136 |
-
except
|
137 |
raise gr.Error(f'API:{e}')
|
138 |
|
139 |
async def amain():
|
|
|
8 |
import gradio as gr
|
9 |
import translators as ts
|
10 |
from gradio_client import Client
|
11 |
+
from requests.exceptions import ConnectionError
|
12 |
from list_dict import translates, speakers
|
13 |
|
14 |
if not os.path.exists('pretrained_models'):
|
|
|
133 |
ts_text = translator(result, TR_LANGUAGE, LANGUAGE)
|
134 |
except ffmpy.FFRuntimeError:
|
135 |
raise gr.Error('Mismatched audio!')
|
136 |
+
except ConnectionError as e:
|
137 |
raise gr.Error(f'API:{e}')
|
138 |
|
139 |
async def amain():
|