Add ui() function to extensions

This commit is contained in:
oobabooga 2023-02-24 19:00:11 -03:00
parent 2b4ce79b6f
commit e51ece21c0
5 changed files with 40 additions and 25 deletions

View file

@ -1,3 +1,5 @@
import gradio as gr
params = {
"bias string": " *I speak in an annoyingly cute way*",
}
@ -25,3 +27,10 @@ def bot_prefix_modifier(string):
"""
return f'{string} {params["bias string"].strip()} '
def ui():
# Gradio elements
string = gr.Textbox(value=params["bias string"], label='Character bias')
# Event functions to update the parameters in the backend
string.change(lambda x: params.update({"bias string": x}), string, None)