EnigmaOfTheWorld commited on
Commit
fa2192f
1 Parent(s): 0bfe03b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -325,10 +325,14 @@ def upload_file(chatbot_history,file_uploaded):
325
  if file_ext not in ['.csv','.xlsx']:
326
  build_embeddings(file_uploaded.name,file_ext)
327
  else:
328
- ask_questions_abt_dataframes(file_uploaded,file_ext)
 
 
 
 
329
 
330
 
331
- return chatbot_history + [(None, f'{os.path.split(file_uploaded.name)[-1]} uploaded start asking question')]
332
 
333
 
334
  def clear_chat_history(history:list)->list:
 
325
  if file_ext not in ['.csv','.xlsx']:
326
  build_embeddings(file_uploaded.name,file_ext)
327
  else:
328
+ try:
329
+ ask_questions_abt_dataframes(file_uploaded,file_ext)
330
+ except Exception as e:
331
+ print(f'Dataframes {e}')
332
+ return chatbot_history + [(None, f'Kindly attempt again at a subsequent time.')]
333
 
334
 
335
+ return chatbot_history + [(None, f'You have uploaded {os.path.split(file_uploaded.name)[-1]} successfully. You can start asking questions about the document.')]
336
 
337
 
338
  def clear_chat_history(history:list)->list: