Add ui() function to extensions
This commit is contained in:
parent
2b4ce79b6f
commit
e51ece21c0
5 changed files with 40 additions and 25 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue