Shreyas094 commited on
Commit
91260de
·
verified ·
1 Parent(s): 34018a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -104,11 +104,10 @@ def chatbot_interface(message, history, model, temperature, num_calls, use_embed
104
  for response in respond(message, history, model, temperature, num_calls, use_embeddings, system_prompt):
105
  history[-1] = (message, response)
106
  yield history
107
- except gr.CancelledError:
108
- yield history
109
  except Exception as e:
110
- logging.error(f"Unexpected error in chatbot_interface: {str(e)}")
111
- history[-1] = (message, f"An unexpected error occurred: {str(e)}")
 
112
  yield history
113
 
114
  def retry_last_response(history, model, temperature, num_calls, use_embeddings, system_prompt):
 
104
  for response in respond(message, history, model, temperature, num_calls, use_embeddings, system_prompt):
105
  history[-1] = (message, response)
106
  yield history
 
 
107
  except Exception as e:
108
+ logging.error(f"Error in chatbot_interface: {str(e)}")
109
+ error_message = f"An error occurred: {str(e)}. Please try again."
110
+ history[-1] = (message, error_message)
111
  yield history
112
 
113
  def retry_last_response(history, model, temperature, num_calls, use_embeddings, system_prompt):