mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-01-09 03:59:05 +01:00
UI: improve the streaming cursor
This commit is contained in:
parent
e2fb86e5df
commit
2acec386fc
@ -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>|<user>|{{user}})", state['name1'], reply + '❚')
|
||||
visible_reply = re.sub("(<USER>|<user>|{{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)
|
||||
|
Loading…
Reference in New Issue
Block a user