mrfakename commited on
Commit
9dc87ec
1 Parent(s): 1a253bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -497,8 +497,10 @@ def synthandreturn(text):
497
  log_text(text)
498
  print("[debug] Using", mdl1, mdl2)
499
  def predict_and_update_result(text, model, result_storage):
500
- print('Trying with', model, 'Using', AVAILABLE_MODELS[model])
501
- result = router.predict(text, AVAILABLE_MODELS[model].lower(), api_name="/synthesize")
 
 
502
  print('Done with', model)
503
  result_storage[model] = result
504
  try:
 
497
  log_text(text)
498
  print("[debug] Using", mdl1, mdl2)
499
  def predict_and_update_result(text, model, result_storage):
500
+ try:
501
+ result = router.predict(text, AVAILABLE_MODELS[model].lower(), api_name="/synthesize")
502
+ except:
503
+ raise gr.Error('Unable to call API, please try again :)')
504
  print('Done with', model)
505
  result_storage[model] = result
506
  try: