Redmind commited on
Commit
bf1b1ca
·
verified ·
1 Parent(s): 72f3118

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -497,16 +497,15 @@ def answer_question(user_question, chatbot, audio=None):
497
  #image = gr.Image(value=img_str)
498
  chatbot.append((user_question,img))
499
  #print(chatbot)
500
- if "send email to" in user_question:
 
501
  try:
502
  os.remove(image_path) # Clean up the temporary image file
503
- except Exception as e:
504
  print(f"Error cleaning up image file: {e}")
505
  except Exception as e:
506
  print(f"Error loading image file: {e}")
507
  chatbot.append((user_question, "Chart generation failed. Please try again."))
508
- else:
509
- chatbot.append((user_question, "Chart generation failed. Please try again."))
510
  return gr.update(value=chatbot)
511
 
512
 
 
497
  #image = gr.Image(value=img_str)
498
  chatbot.append((user_question,img))
499
  #print(chatbot)
500
+
501
+ if "send email to" in user_question:
502
  try:
503
  os.remove(image_path) # Clean up the temporary image file
504
+ except Exception as e:
505
  print(f"Error cleaning up image file: {e}")
506
  except Exception as e:
507
  print(f"Error loading image file: {e}")
508
  chatbot.append((user_question, "Chart generation failed. Please try again."))
 
 
509
  return gr.update(value=chatbot)
510
 
511