From 2acec386fc6647782e30cbddbc298652a2224b3c Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:08:56 -0800 Subject: [PATCH] UI: improve the streaming cursor --- modules/chat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index 92808fb7..2638c794 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -353,14 +353,14 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False, loading_mess # Extract the reply if state['mode'] in ['chat', 'chat-instruct']: - visible_reply = re.sub("(||{{user}})", state['name1'], reply + '❚') + visible_reply = re.sub("(||{{user}})", state['name1'], reply + '▍') else: - visible_reply = reply + '❚' + visible_reply = reply + '▍' visible_reply = html.escape(visible_reply) if shared.stop_everything: - if output['visible'][-1][1].endswith('❚'): + if output['visible'][-1][1].endswith('▍'): output['visible'][-1][1] = output['visible'][-1][1][:-1] output['visible'][-1][1] = apply_extensions('output', output['visible'][-1][1], state, is_chat=True) @@ -378,7 +378,7 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False, loading_mess if is_stream: yield output - if output['visible'][-1][1].endswith('❚'): + if output['visible'][-1][1].endswith('▍'): output['visible'][-1][1] = output['visible'][-1][1][:-1] output['visible'][-1][1] = apply_extensions('output', output['visible'][-1][1], state, is_chat=True)