barunsaha commited on
Commit
21b63a4
·
unverified ·
2 Parent(s): 1b4f784 258a34d

Merge pull request #88 from barun-saha/visual

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -367,21 +367,18 @@ def set_up_chat_ui():
367
  True
368
  )
369
  return
370
- except huggingface_hub.utils._errors.HfHubHTTPError as hfe:
371
- _msg = str(hfe).lower()
372
  if 'payment required' in _msg:
373
- _msg = (
374
  'The available inference quota has exhausted.'
375
  ' Please use your own Hugging Face access token. Paste your token in'
376
  ' the input field on the sidebar to the left.'
377
  '\n\nDon\'t have a token? Get your free'
378
  ' [HF access token](https://huggingface.co/settings/tokens) now'
379
- ' and create a magical slide deck!'
 
380
  )
381
-
382
- handle_error(_msg, should_log=True)
383
- return
384
- except Exception as ex:
385
  handle_error(
386
  f'An unexpected error occurred while generating the content: {ex}'
387
  '\n\nPlease try again later, possibly with different inputs.'
 
367
  True
368
  )
369
  return
370
+ except Exception as ex:
371
+ _msg = str(ex).lower()
372
  if 'payment required' in _msg:
373
+ handle_error(
374
  'The available inference quota has exhausted.'
375
  ' Please use your own Hugging Face access token. Paste your token in'
376
  ' the input field on the sidebar to the left.'
377
  '\n\nDon\'t have a token? Get your free'
378
  ' [HF access token](https://huggingface.co/settings/tokens) now'
379
+ ' and create a magical slide deck!',
380
+ should_log=True
381
  )
 
 
 
 
382
  handle_error(
383
  f'An unexpected error occurred while generating the content: {ex}'
384
  '\n\nPlease try again later, possibly with different inputs.'