mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
Do not set value for histories in chat when --multi-user is used (#6317)
This commit is contained in:
parent
055f3f5632
commit
0f90a1b50f
@ -1059,7 +1059,12 @@ def handle_start_new_chat_click(state):
|
|||||||
|
|
||||||
convert_to_markdown.cache_clear()
|
convert_to_markdown.cache_clear()
|
||||||
|
|
||||||
return [history, html, gr.update(choices=histories, value=histories[0][1])]
|
if len(histories) > 0:
|
||||||
|
past_chats_update = gr.update(choices=histories, value=histories[0][1])
|
||||||
|
else:
|
||||||
|
past_chats_update = gr.update(choices=histories)
|
||||||
|
|
||||||
|
return [history, html, past_chats_update]
|
||||||
|
|
||||||
|
|
||||||
def handle_delete_chat_confirm_click(state):
|
def handle_delete_chat_confirm_click(state):
|
||||||
@ -1110,10 +1115,15 @@ def handle_upload_chat_history(load_chat_history, state):
|
|||||||
|
|
||||||
convert_to_markdown.cache_clear()
|
convert_to_markdown.cache_clear()
|
||||||
|
|
||||||
|
if len(histories) > 0:
|
||||||
|
past_chats_update = gr.update(choices=histories, value=histories[0][1])
|
||||||
|
else:
|
||||||
|
past_chats_update = gr.update(choices=histories)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
history,
|
history,
|
||||||
html,
|
html,
|
||||||
gr.update(choices=histories, value=histories[0][1])
|
past_chats_update
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -1132,6 +1142,11 @@ def handle_character_menu_change(state):
|
|||||||
|
|
||||||
convert_to_markdown.cache_clear()
|
convert_to_markdown.cache_clear()
|
||||||
|
|
||||||
|
if len(histories) > 0:
|
||||||
|
past_chats_update = gr.update(choices=histories, value=histories[0][1])
|
||||||
|
else:
|
||||||
|
past_chats_update = gr.update(choices=histories)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
history,
|
history,
|
||||||
html,
|
html,
|
||||||
@ -1140,7 +1155,7 @@ def handle_character_menu_change(state):
|
|||||||
picture,
|
picture,
|
||||||
greeting,
|
greeting,
|
||||||
context,
|
context,
|
||||||
gr.update(choices=histories, value=histories[0][1]),
|
past_chats_update,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -1151,12 +1166,17 @@ def handle_mode_change(state):
|
|||||||
|
|
||||||
convert_to_markdown.cache_clear()
|
convert_to_markdown.cache_clear()
|
||||||
|
|
||||||
|
if len(histories) > 0:
|
||||||
|
past_chats_update = gr.update(choices=histories, value=histories[0][1])
|
||||||
|
else:
|
||||||
|
past_chats_update = gr.update(choices=histories)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
history,
|
history,
|
||||||
html,
|
html,
|
||||||
gr.update(visible=state['mode'] != 'instruct'),
|
gr.update(visible=state['mode'] != 'instruct'),
|
||||||
gr.update(visible=state['mode'] == 'chat-instruct'),
|
gr.update(visible=state['mode'] == 'chat-instruct'),
|
||||||
gr.update(choices=histories, value=histories[0][1])
|
past_chats_update
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user