From ac7d82380ad70f27a6d47acf7fe62f9e3aab2d6a Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Mon, 12 Jun 2023 18:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=8D=E7=94=A8prompt?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func_box.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/func_box.py b/func_box.py index a4e6260..1e1c8db 100644 --- a/func_box.py +++ b/func_box.py @@ -486,10 +486,10 @@ def reuse_chat(result, chatbot, history, pro_numb): else: if pro_numb: chatbot.append(result) - history += [pattern_markdown.sub('', i) for i in result] + history += [pattern_markdown.sub('', _) for i in result for _ in i] else: chatbot.append(result[-1]) - history += [pattern_markdown.sub('', i) for i in result[-2:]] + history += [pattern_markdown.sub('', _) for i in result[-2:] for _ in i] i_say = pattern_markdown.sub('', chatbot[-1][0]) return chatbot, history, i_say, gr.Tabs.update(selected='chatbot'), '' @@ -565,5 +565,6 @@ class JsonHandle: if __name__ == '__main__': - loading = [''.join(['.' * random.randint(1, 5)])] - print(loading) \ No newline at end of file + result = [['214214', '5657'], ['fasfaf', '41241'],['kkkgh', '1`31`3'],] + ff = [pattern_markdown.sub('', _) for i in result[-2:] for _ in i] + print(ff) \ No newline at end of file