hadadrjt commited on
Commit
8307f2f
·
1 Parent(s): 7d6f26e

ai: Call session close function once.

Browse files
Files changed (1) hide show
  1. app.py +0 -2
app.py CHANGED
@@ -100,7 +100,6 @@ def respond(user_input, history, selected_model_display):
100
  ai_response = ""
101
  for chunk in chat_with_model(history, user_input, selected_model_display):
102
  if stop_event.is_set():
103
- session.close()
104
  history[-1][1] = RESPONSES["RESPONSE_1"]
105
  yield history, gr.update(value=""), gr.update(visible=True), gr.update(visible=False)
106
  return
@@ -108,7 +107,6 @@ def respond(user_input, history, selected_model_display):
108
  history[-1][1] = ai_response
109
  yield history, gr.update(value=""), gr.update(visible=False), gr.update(visible=True)
110
 
111
- session.close()
112
  yield history, gr.update(value=""), gr.update(visible=True), gr.update(visible=False)
113
 
114
  def stop_response():
 
100
  ai_response = ""
101
  for chunk in chat_with_model(history, user_input, selected_model_display):
102
  if stop_event.is_set():
 
103
  history[-1][1] = RESPONSES["RESPONSE_1"]
104
  yield history, gr.update(value=""), gr.update(visible=True), gr.update(visible=False)
105
  return
 
107
  history[-1][1] = ai_response
108
  yield history, gr.update(value=""), gr.update(visible=False), gr.update(visible=True)
109
 
 
110
  yield history, gr.update(value=""), gr.update(visible=True), gr.update(visible=False)
111
 
112
  def stop_response():