From 69ffef43912ff27f31803558a4d45f2e44267692 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 27 Jan 2023 12:01:11 -0300 Subject: [PATCH] History loading minor bug fix --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 85e90017..e70738e3 100644 --- a/server.py +++ b/server.py @@ -8,6 +8,7 @@ import json import sys from sys import exit from pathlib import Path +import copy import gradio as gr import warnings from tqdm import tqdm @@ -458,7 +459,7 @@ if args.chat or args.cai_chat: if 'data_visible' in j: history['visible'] = j['data_visible'] else: - history['visible'] = history['internal'] + history['visible'] = copy.deepcopy(history['internal']) # Compatibility with Pygmalion AI's official web UI elif 'chat' in j: history['internal'] = [':'.join(x.split(':')[1:]).strip() for x in j['chat']] @@ -468,7 +469,7 @@ if args.chat or args.cai_chat: history['internal'] = [[history['internal'][i], history['internal'][i+1]] for i in range(0, len(history['internal'])-1, 2)] except: history['internal'] = tokenize_dialogue(file, name1, name2) - history['visible'] = history['internal'] + history['visible'] = copy.deepcopy(history['internal']) def load_character(_character, name1, name2): global history, character