This commit is contained in:
oobabooga 2024-01-09 16:27:50 -08:00
parent bec4e0a1ce
commit 89e7e107fc
5 changed files with 22 additions and 21 deletions

View file

@ -529,6 +529,7 @@ def load_history_after_deletion(state, idx):
histories = find_all_histories(state)
idx = min(int(idx), len(histories) - 1)
idx = max(0, idx)
if len(histories) > 0:
history = load_history(histories[idx], state['character_menu'], state['mode'])
@ -542,6 +543,7 @@ def load_history_after_deletion(state, idx):
def update_character_menu_after_deletion(idx):
characters = utils.get_available_characters()
idx = min(int(idx), len(characters) - 1)
idx = max(0, idx)
return gr.update(choices=characters, value=characters[idx])