Reformat everything

This commit is contained in:
oobabooga
2023-04-07 00:08:46 -03:00
parent 848c4edfd5
commit 01cacfc14f
29 changed files with 334 additions and 193 deletions

View File

@@ -5,14 +5,16 @@ params = {
"bias string": " *I am so happy*",
}
def input_modifier(string):
"""
This function is applied to your text inputs before
they are fed into the model.
"""
"""
return string
def output_modifier(string):
"""
This function is applied to the model outputs.
@@ -20,6 +22,7 @@ def output_modifier(string):
return string
def bot_prefix_modifier(string):
"""
This function is only applied in chat mode. It modifies
@@ -27,11 +30,12 @@ def bot_prefix_modifier(string):
behavior.
"""
if params['activate'] == True:
if params['activate']:
return f'{string} {params["bias string"].strip()} '
else:
return string
def ui():
# Gradio elements
activate = gr.Checkbox(value=params['activate'], label='Activate character bias')