Add Save/Delete character buttons (#1870)

---------

Co-authored-by: oobabooga <112222186+oobabooga@users.noreply.github.com>
This commit is contained in:
Matthew McAllister 2023-05-20 17:48:45 -07:00 committed by GitHub
parent c5af549d4b
commit ab6acddcc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 6 deletions

View file

@ -15,6 +15,9 @@ with open(Path(__file__).resolve().parent / '../css/chat.js', 'r') as f:
chat_js = f.read()
refresh_symbol = '\U0001f504' # 🔄
delete_symbol = '🗑️'
save_symbol = '💾'
theme = gr.themes.Default(
font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
@ -89,3 +92,11 @@ def create_refresh_button(refresh_component, refresh_method, refreshed_args, ele
outputs=[refresh_component]
)
return refresh_button
def create_delete_button(**kwargs):
return ToolButton(value=delete_symbol, **kwargs)
def create_save_button(**kwargs):
return ToolButton(value=save_symbol, **kwargs)