ysharma HF staff commited on
Commit
15b0b67
1 Parent(s): dcad3c4

update debugging info

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -155,20 +155,22 @@ def retry_last_answer(
155
  print(f"max_length is - {max_length}")
156
  print(f"top_p is - {top_p}")
157
  print(f"temperature is - {temperature}")
158
- print(f"past_key_values is - {past_key_values}")
159
 
160
  if chatbot and history:
161
  # Removing the previous conversation from chat
162
  chatbot.pop(-1)
163
  # Removing bot response from the history
164
- history.pop(-1)
 
165
  # Setting up a flag to capture a retry
166
  RETRY_FLAG = True
167
  # Getting last message from user
168
- user_input = history[-1]
169
 
170
  print(f"popped chatbot is - {chatbot}")
171
  print(f"popped history is - {history}")
 
172
 
173
  yield from predict(
174
  RETRY_FLAG,
 
155
  print(f"max_length is - {max_length}")
156
  print(f"top_p is - {top_p}")
157
  print(f"temperature is - {temperature}")
158
+ print(f"past_key_values type is - {type(past_key_values)}")
159
 
160
  if chatbot and history:
161
  # Removing the previous conversation from chat
162
  chatbot.pop(-1)
163
  # Removing bot response from the history
164
+ #history.pop(-1)
165
+ history[-1] = (history[-1][0],)
166
  # Setting up a flag to capture a retry
167
  RETRY_FLAG = True
168
  # Getting last message from user
169
+ user_input = history[-1][0]
170
 
171
  print(f"popped chatbot is - {chatbot}")
172
  print(f"popped history is - {history}")
173
+ print(f"user_input is - {user_input}")
174
 
175
  yield from predict(
176
  RETRY_FLAG,