Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
64764e8
1
Parent(s):
40b0dd7
bugfix: 修复修复损坏的历史记录的时候出错的问题
Browse files
modules/models/base_model.py
CHANGED
@@ -787,7 +787,7 @@ class BaseLLMModel:
|
|
787 |
logging.info(new_history)
|
788 |
except:
|
789 |
pass
|
790 |
-
if len(json_s["chatbot"]) < len(json_s["history"]):
|
791 |
logging.info("Trimming corrupted history...")
|
792 |
json_s["history"] = json_s["history"][-len(json_s["chatbot"]):]
|
793 |
logging.info(f"Trimmed history: {json_s['history']}")
|
|
|
787 |
logging.info(new_history)
|
788 |
except:
|
789 |
pass
|
790 |
+
if len(json_s["chatbot"]) < len(json_s["history"])//2:
|
791 |
logging.info("Trimming corrupted history...")
|
792 |
json_s["history"] = json_s["history"][-len(json_s["chatbot"]):]
|
793 |
logging.info(f"Trimmed history: {json_s['history']}")
|