ysharma HF staff commited on
Commit
136a64f
1 Parent(s): 18a6872

fixed user input for retry logic

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -165,13 +165,13 @@ def retry_last_answer(
165
  if chatbot and history:
166
  # Removing the previous conversation from chat
167
  chatbot.pop(-1)
168
- # Removing bot response from the history
169
- history.pop(-1)
170
  #history[-1] = (history[-1][0],)
171
  # Setting up a flag to capture a retry
172
  RETRY_FLAG = True
173
  # Getting last message from user
174
  user_input = history[-1][0]
 
 
175
 
176
  print(f"popped chatbot is - {chatbot}")
177
  print(f"popped history is - {history}")
 
165
  if chatbot and history:
166
  # Removing the previous conversation from chat
167
  chatbot.pop(-1)
 
 
168
  #history[-1] = (history[-1][0],)
169
  # Setting up a flag to capture a retry
170
  RETRY_FLAG = True
171
  # Getting last message from user
172
  user_input = history[-1][0]
173
+ # Removing bot response from the history
174
+ history.pop(-1)
175
 
176
  print(f"popped chatbot is - {chatbot}")
177
  print(f"popped history is - {history}")