From 75fd763f99afe6d006c3806aef53fa7c6d977b9f Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 25 Jun 2023 18:14:57 -0300 Subject: [PATCH] Fix chat saving issue (closes #2863) --- modules/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index 328ba834..e30fc516 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -394,7 +394,7 @@ def tokenize_dialogue(dialogue, name1, name2): return history -def save_history(mode, timestamp=False): +def save_history(mode, timestamp=False, user_request=False): # Instruct mode histories should not be saved as if # Alpaca or Vicuna were characters if mode == 'instruct': @@ -403,7 +403,7 @@ def save_history(mode, timestamp=False): fname = f"Instruct_{datetime.now().strftime('%Y%m%d-%H%M%S')}.json" else: - if shared.character == 'None': + if shared.character == 'None' and not user_request: return if timestamp: