UI: make Default/Notebook contents persist on page reload

This commit is contained in:
oobabooga 2024-07-22 11:05:40 -07:00
parent 8768b69a2d
commit f2d802e707
3 changed files with 18 additions and 3 deletions

View file

@ -230,8 +230,14 @@ def gather_interface_values(*args):
def apply_interface_values(state, use_persistent=False):
if use_persistent:
state = shared.persistent_interface_state
if 'textbox-default' in state:
state.pop('prompt_menu-default')
if 'textbox-notebook' in state:
state.pop('prompt_menu-notebook')
elements = list_interface_input_elements()
if len(state) == 0:
return [gr.update() for k in elements] # Dummy, do nothing
else: