소스 검색

Reset the history if no default history exists on reload

oobabooga 2 년 전
부모
커밋
dac6fe0ff4
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      modules/chat.py

+ 3 - 0
modules/chat.py

@@ -303,6 +303,9 @@ def load_history(file, name1, name2):
 def load_default_history(name1, name2):
     if Path(f'logs/persistent.json').exists():
         load_history(open(Path(f'logs/persistent.json'), 'rb').read(), name1, name2)
+    else:
+        shared.history['internal'] = []
+        shared.history['visible'] = []
 
 def load_character(_character, name1, name2):
     context = ""