Make the code more like PEP8 for readability (#862)

This commit is contained in:
oobabooga 2023-04-07 00:15:45 -03:00 committed by GitHub
parent 848c4edfd5
commit ea6e77df72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 302 additions and 165 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')