郑毅 1 сар өмнө
parent
commit
74560db0d8
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      kimi/chat.py

+ 1 - 1
kimi/chat.py

@@ -36,7 +36,7 @@ class Chat:
             "content": result
         })
         # 随着对话的进行,模型每次需要传入的 token 都会线性增加,只保留特定几轮对话
-        if self.save_first_len + self.save_last_len > len(self.history):
+        if self.save_first_len + self.save_last_len < len(self.history):
             self.history = self.history[0:self.save_first_len] + self.history[len(self.history) - self.save_last_len:]
         
         return result