Make the code more like PEP8

This commit is contained in:
oobabooga
2023-04-07 00:00:16 -03:00
parent 8e4e8dd741
commit 7b1b1d8e39
30 changed files with 314 additions and 177 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')