imomayiz commited on
Commit
d7fc1aa
1 Parent(s): ef41547

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -15,8 +15,11 @@ def respond(english_text):
15
  try:
16
  output = response[0]['generated_text']
17
 
18
- except KeyError:
19
- output = f"Model is loading. Estimated time {output['estimated_time']}"
 
 
 
20
 
21
  return output
22
 
 
15
  try:
16
  output = response[0]['generated_text']
17
 
18
+ except Exception as e:
19
+ if 'estimated_time' in response:
20
+ output = f"Model is loading. Estimated time {response['estimated_time']}"
21
+ else:
22
+ output = e
23
 
24
  return output
25