From 2289d3686f74e73ea03334fbc1373a715f28ba9a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:43:23 -0300 Subject: [PATCH] Update API example --- api-example.py | 2 ++ server.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api-example.py b/api-example.py index 23710047..60b95d75 100644 --- a/api-example.py +++ b/api-example.py @@ -37,6 +37,8 @@ params = { 'seed': -1, 'add_bos_token': True, 'custom_stopping_strings': [], + 'truncation_length': 2048, + 'ban_eos_token': False, } # Input prompt diff --git a/server.py b/server.py index 9bbd1e4b..54dac6e0 100644 --- a/server.py +++ b/server.py @@ -275,7 +275,7 @@ def create_settings_menus(default_preset): with gr.Group(): with gr.Row(): shared.gradio['add_bos_token'] = gr.Checkbox(value=shared.settings['add_bos_token'], label='Add the bos_token to the beginning of prompts', info='Disabling this can make the replies more creative.') - shared.gradio['ban_eos_token'] = gr.Checkbox(value=shared.settings['ban_eos_token'], label='Ban the eos token', info='This forces the model to never end the generation prematurely.') + shared.gradio['ban_eos_token'] = gr.Checkbox(value=shared.settings['ban_eos_token'], label='Ban the eos_token', info='This forces the model to never end the generation prematurely.') shared.gradio['truncation_length'] = gr.Slider(value=shared.settings['truncation_length'], minimum=shared.settings['truncation_length_min'], maximum=shared.settings['truncation_length_max'], step=1, label='Truncate the prompt up to this length', info='The leftmost tokens are removed if the prompt exceeds this length. Most models require this to be at most 2048.') shared.gradio['custom_stopping_strings'] = gr.Textbox(lines=1, value=shared.settings["custom_stopping_strings"] or None, label='Custom stopping strings', info='In addition to the defaults. Written between "" and separated by commas. For instance: "\\nYour Assistant:", "\\nThe assistant:"')