Fix chat saving issue (closes #2863)

This commit is contained in:
oobabooga 2023-06-25 18:14:57 -03:00
parent 21c189112c
commit 75fd763f99

View File

@ -394,7 +394,7 @@ def tokenize_dialogue(dialogue, name1, name2):
return history 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 # Instruct mode histories should not be saved as if
# Alpaca or Vicuna were characters # Alpaca or Vicuna were characters
if mode == 'instruct': 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" fname = f"Instruct_{datetime.now().strftime('%Y%m%d-%H%M%S')}.json"
else: else:
if shared.character == 'None': if shared.character == 'None' and not user_request:
return return
if timestamp: if timestamp: