mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-02-09 01:58:21 +01:00
Send last input to the input box when "Remove last" is clicked
This commit is contained in:
parent
3c5454c6f8
commit
d87310ad61
@ -336,12 +336,12 @@ if args.chat or args.cai_chat:
|
|||||||
yield i
|
yield i
|
||||||
|
|
||||||
def remove_last_message(name1, name2):
|
def remove_last_message(name1, name2):
|
||||||
history.pop()
|
last = history.pop()
|
||||||
_history = remove_example_dialogue_from_history(history)
|
_history = remove_example_dialogue_from_history(history)
|
||||||
if args.cai_chat:
|
if args.cai_chat:
|
||||||
return generate_chat_html(_history, name1, name2, character)
|
return generate_chat_html(_history, name1, name2, character), last[0]
|
||||||
else:
|
else:
|
||||||
return _history
|
return _history, last[0]
|
||||||
|
|
||||||
def clear():
|
def clear():
|
||||||
global history
|
global history
|
||||||
@ -471,7 +471,7 @@ if args.chat or args.cai_chat:
|
|||||||
gen_event3 = btn_regenerate.click(regenerate_wrapper, input_params, display1, show_progress=args.no_stream)
|
gen_event3 = btn_regenerate.click(regenerate_wrapper, input_params, display1, show_progress=args.no_stream)
|
||||||
|
|
||||||
btn_clear.click(clear)
|
btn_clear.click(clear)
|
||||||
btn_remove_last.click(remove_last_message, [name1, name2], display1, show_progress=False)
|
btn_remove_last.click(remove_last_message, [name1, name2], [display1, textbox], show_progress=False)
|
||||||
btn.click(lambda x: "", textbox, textbox, show_progress=False)
|
btn.click(lambda x: "", textbox, textbox, show_progress=False)
|
||||||
btn_regenerate.click(lambda x: "", textbox, textbox, show_progress=False)
|
btn_regenerate.click(lambda x: "", textbox, textbox, show_progress=False)
|
||||||
textbox.submit(lambda x: "", textbox, textbox, show_progress=False)
|
textbox.submit(lambda x: "", textbox, textbox, show_progress=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user