barunsaha commited on
Commit
72225b3
·
unverified ·
2 Parent(s): 1e4fb72 b1fed52

Merge pull request #187 from barun-saha/visual

Browse files

Update Streamlit, error handling, and prepare for a new release

README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🏢
4
  colorFrom: yellow
5
  colorTo: green
6
  sdk: streamlit
7
- sdk_version: 1.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: yellow
5
  colorTo: green
6
  sdk: streamlit
7
+ sdk_version: 1.52.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -478,29 +478,15 @@ def set_up_chat_ui():
478
  True
479
  )
480
  except Exception as ex:
481
- _msg = str(ex)
482
- if 'payment required' in _msg.lower():
483
  handle_error(
484
- 'The available inference quota has exhausted.'
485
- ' Please use your own Hugging Face access token. Paste your token in'
486
- ' the input field on the sidebar to the left.'
487
- '\n\nDon\'t have a token? Get your free'
488
- ' [HF access token](https://huggingface.co/settings/tokens) now'
489
- ' and start creating your slide deck! For gated models, you may need to'
490
- ' visit the model\'s page and accept the terms or service.'
491
- '\n\nAlternatively, choose a different LLM and provider from the list.',
492
- should_log=True
493
- )
494
- else:
495
- handle_error(
496
- f'An unexpected error occurred while generating the content: {_msg}'
497
- '\n\nPlease try again later, possibly with different inputs.'
498
- ' Alternatively, try selecting a different LLM from the dropdown list.'
499
- ' If you are using Azure OpenAI, Cohere, Gemini, or Together AI models, make'
500
- ' sure that you have provided a correct API key.'
501
- ' Read **[how to get free LLM API keys](https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#summary-of-the-llms)**.',
502
  True
503
  )
 
 
504
 
505
 
506
  def _is_it_refinement() -> bool:
 
478
  True
479
  )
480
  except Exception as ex:
481
+ if 'litellm.AuthenticationError' in str(ex):
 
482
  handle_error(
483
+ f'LLM API authentication failed: {ex}'
484
+ '\nMake sure that you have provided a valid, correct API key.'
485
+ ' Read **[how to get free LLM API keys](https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#unmatched-flexibility-choose-your-ai-brain)**.',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  True
487
  )
488
+ else:
489
+ handle_error('An unexpected error occurred: ' + str(ex), True)
490
 
491
 
492
  def _is_it_refinement() -> bool:
requirements.txt CHANGED
@@ -9,7 +9,7 @@ pyarrow~=16.0.0
9
  pydantic~=2.12.5
10
  litellm~=1.80.7
11
  google-generativeai # ~=0.8.3
12
- streamlit==1.52.0
13
 
14
  python-pptx~=1.0.2
15
  json5~=0.12.1
 
9
  pydantic~=2.12.5
10
  litellm~=1.80.7
11
  google-generativeai # ~=0.8.3
12
+ streamlit==1.52.1
13
 
14
  python-pptx~=1.0.2
15
  json5~=0.12.1
src/slidedeckai/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '8.0.4'
 
1
+ __version__ = '8.0.5'
src/slidedeckai/core.py CHANGED
@@ -260,7 +260,7 @@ class SlideDeckAI:
260
  output_file_path=path
261
  )
262
  except Exception as ex:
263
- logger.exception('Caught a generic exception: %s', str(ex))
264
  return None
265
 
266
  return path
 
260
  output_file_path=path
261
  )
262
  except Exception as ex:
263
+ logger.error('Caught a generic exception: %s', str(ex))
264
  return None
265
 
266
  return path
src/slidedeckai/global_config.py CHANGED
@@ -226,9 +226,9 @@ class GlobalConfig:
226
  ' You do not need to upload the same file again to continue'
227
  ' the interaction and refining—the contents of the PDF file will be retained in the'
228
  ' same interactive session.'
229
- '\n\nCurrently, paid or *free-to-use* LLMs from eight different providers are supported.'
230
  ' A [summary of the supported LLMs]('
231
- 'https://github.com/barun-saha/slide-deck-ai/blob/main/README.md#summary-of-the-llms)'
232
  ' is available for reference. SlideDeck AI does **NOT** store your API keys.'
233
  '\n\nSlideDeck AI does not have access to the Web, apart for searching for images relevant'
234
  ' to the slides. Photos are added probabilistically; transparency needs to be changed'
 
226
  ' You do not need to upload the same file again to continue'
227
  ' the interaction and refining—the contents of the PDF file will be retained in the'
228
  ' same interactive session.'
229
+ '\n\nCurrently, paid or *free-to-use* LLMs from several providers are supported.'
230
  ' A [summary of the supported LLMs]('
231
+ 'https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#unmatched-flexibility-choose-your-ai-brain)'
232
  ' is available for reference. SlideDeck AI does **NOT** store your API keys.'
233
  '\n\nSlideDeck AI does not have access to the Web, apart for searching for images relevant'
234
  ' to the slides. Photos are added probabilistically; transparency needs to be changed'
src/slidedeckai/helpers/llm_helper.py CHANGED
@@ -216,7 +216,7 @@ def stream_litellm_completion(
216
  yield choice.message.content
217
 
218
  except Exception as e:
219
- logger.exception('Error in LiteLLM completion: %s', e)
220
  raise
221
 
222
 
 
216
  yield choice.message.content
217
 
218
  except Exception as e:
219
+ logger.error('Error in LiteLLM completion: %s', e)
220
  raise
221
 
222