huseinzol05
commited on
Commit
•
27e119d
1
Parent(s):
349bdff
fix
Browse files
app.py
CHANGED
@@ -99,7 +99,7 @@ def translate(text, model_name, to_lang):
|
|
99 |
json=json_data,
|
100 |
)
|
101 |
if response.status_code != 200:
|
102 |
-
raise
|
103 |
|
104 |
t = response.json()['result']
|
105 |
return t
|
|
|
99 |
json=json_data,
|
100 |
)
|
101 |
if response.status_code != 200:
|
102 |
+
raise gr.Error('API error.')
|
103 |
|
104 |
t = response.json()['result']
|
105 |
return t
|