From 6b9ac2f88e590a677a70dbed58c9aa539652d86f Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 17 Feb 2023 16:18:01 -0300 Subject: [PATCH] Reorganize the generation parameters --- modules/ui.py | 19 ++++++++++--------- ... => Instruct Joi (Contrastive Search).txt} | 0 ...{Verbose.txt => Verbose (Beam Search).txt} | 0 server.py | 19 +++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) rename presets/{Instruct-Joi.txt => Instruct Joi (Contrastive Search).txt} (100%) rename presets/{Verbose.txt => Verbose (Beam Search).txt} (100%) diff --git a/modules/ui.py b/modules/ui.py index 72b6e9fe..b0fbc161 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -13,19 +13,20 @@ css = """ background-color: #ffffff1f; } #refresh-button { - flex: none; - margin: 0; - padding: 0; - min-width: 50px; - border: none; - box-shadow: none; - border-radius: 10px; - background-color: #0000000d; + flex: none; + margin: 0; + padding: 0; + min-width: 50px; + border: none; + box-shadow: none; + border-radius: 10px; + background-color: #0000000d; } #download-label, #upload-label { - min-height: 0 + min-height: 0 } #accordion { + background-color: transparent; } """ diff --git a/presets/Instruct-Joi.txt b/presets/Instruct Joi (Contrastive Search).txt similarity index 100% rename from presets/Instruct-Joi.txt rename to presets/Instruct Joi (Contrastive Search).txt diff --git a/presets/Verbose.txt b/presets/Verbose (Beam Search).txt similarity index 100% rename from presets/Verbose.txt rename to presets/Verbose (Beam Search).txt diff --git a/server.py b/server.py index 181a3c9d..84a4be0e 100644 --- a/server.py +++ b/server.py @@ -468,19 +468,18 @@ def create_settings_menus(): top_p = gr.Slider(0.0,1.0,value=generate_params['top_p'],step=0.01,label="top_p") typical_p = gr.Slider(0.0,1.0,value=generate_params['typical_p'],step=0.01,label="typical_p") with gr.Column(): - repetition_penalty = gr.Slider(1.0,4.99,value=generate_params['repetition_penalty'],step=0.01,label="repetition_penalty") top_k = gr.Slider(0,200,value=generate_params['top_k'],step=1,label="top_k") + repetition_penalty = gr.Slider(1.0,4.99,value=generate_params['repetition_penalty'],step=0.01,label="repetition_penalty") no_repeat_ngram_size = gr.Slider(0, 20, step=1, value=generate_params["no_repeat_ngram_size"], label="no_repeat_ngram_size") - penalty_alpha = gr.Slider(0, 5, value=generate_params["penalty_alpha"], label="penalty_alpha") - - gr.Markdown("Special parameters (only use them if you really need them):") - with gr.Row(): - with gr.Column(): - num_beams = gr.Slider(0, 20, step=1, value=generate_params["num_beams"], label="num_beams") - length_penalty = gr.Slider(-5, 5, value=generate_params["length_penalty"], label="length_penalty") - with gr.Column(): min_length = gr.Slider(0, 2000, step=1, value=generate_params["min_length"] if args.no_stream else 0, label="min_length", interactive=args.no_stream) - early_stopping = gr.Checkbox(value=generate_params["early_stopping"], label="early_stopping") + + gr.Markdown("Contrastive search:") + penalty_alpha = gr.Slider(0, 5, value=generate_params["penalty_alpha"], label="penalty_alpha") + + gr.Markdown("Beam search (uses a lot of VRAM):") + num_beams = gr.Slider(1, 20, step=1, value=generate_params["num_beams"], label="num_beams") + length_penalty = gr.Slider(-5, 5, value=generate_params["length_penalty"], label="length_penalty") + early_stopping = gr.Checkbox(value=generate_params["early_stopping"], label="early_stopping") with gr.Accordion("Soft prompt", open=False, elem_id="accordion"): with gr.Row():