Tuchuanhuhuhu commited on
Commit
496913a
1 Parent(s): 911a95b

修复poping from empty list bug

Browse files
Files changed (1) hide show
  1. utils.py +4 -3
utils.py CHANGED
@@ -215,9 +215,10 @@ def delete_last_conversation(chatbot, history):
215
  chatbot.pop()
216
  print(history)
217
  return chatbot, history
218
- history.pop()
219
- history.pop()
220
- print(history)
 
221
  return chatbot, history
222
 
223
  def save_chat_history(filename, system, history, chatbot):
 
215
  chatbot.pop()
216
  print(history)
217
  return chatbot, history
218
+ if len(history) > 0:
219
+ history.pop()
220
+ history.pop()
221
+ print(history)
222
  return chatbot, history
223
 
224
  def save_chat_history(filename, system, history, chatbot):