Spaces:
Running
Running
Merge pull request #88 from barun-saha/visual
Browse files
app.py
CHANGED
@@ -367,21 +367,18 @@ def set_up_chat_ui():
|
|
367 |
True
|
368 |
)
|
369 |
return
|
370 |
-
except
|
371 |
-
_msg = str(
|
372 |
if 'payment required' in _msg:
|
373 |
-
|
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.'
|