Skip to content

Commit

Permalink
bugfix: 隐藏历史记录时出现问题 fix #883
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Oct 14, 2023
1 parent efd54c9 commit 8dbdf7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/models/OpenAI.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _single_query_at_once(self, history, temperature=1.0):


def auto_name_chat_history(self, name_chat_method, user_question, chatbot, user_name, single_turn_checkbox):
if len(self.history) == 2 and not single_turn_checkbox:
if len(self.history) == 2 and not single_turn_checkbox and not hide_history_when_not_logged_in:
user_question = self.history[0]["content"]
if name_chat_method == i18n("模型自动总结(消耗tokens)"):
ai_answer = self.history[1]["content"]
Expand Down
2 changes: 2 additions & 0 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ def construct_assistant(text):

def save_file(filename, system, history, chatbot, user_name):
os.makedirs(os.path.join(HISTORY_DIR, user_name), exist_ok=True)
if filename is None:
filename = new_auto_history_filename(user_name)
if filename.endswith(".md"):
filename = filename[:-3]
if not filename.endswith(".json") and not filename.endswith(".md"):
Expand Down

0 comments on commit 8dbdf7a

Please sign in to comment.