From cbd65ba767b3ac8c87fa95c5e633b8aec24c2777 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:50:16 -0300 Subject: [PATCH] Add a simple min_p preset, make it the default (#5836) --- modules/shared.py | 2 +- modules/ui_parameters.py | 2 +- presets/min_p.yaml | 1 + settings-template.yaml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 presets/min_p.yaml diff --git a/modules/shared.py b/modules/shared.py index 46b6ef47..431e6249 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -36,7 +36,7 @@ settings = { 'chat_style': 'cai-chat', 'prompt-default': 'QA', 'prompt-notebook': 'QA', - 'preset': 'simple-1', + 'preset': 'min_p', 'max_new_tokens': 512, 'max_new_tokens_min': 1, 'max_new_tokens_max': 4096, diff --git a/modules/ui_parameters.py b/modules/ui_parameters.py index 7090d01d..b3adc570 100644 --- a/modules/ui_parameters.py +++ b/modules/ui_parameters.py @@ -32,6 +32,7 @@ def create_ui(default_preset): shared.gradio['top_p'] = gr.Slider(0.0, 1.0, value=generate_params['top_p'], step=0.01, label='top_p') shared.gradio['top_k'] = gr.Slider(0, 200, value=generate_params['top_k'], step=1, label='top_k') shared.gradio['typical_p'] = gr.Slider(0.0, 1.0, value=generate_params['typical_p'], step=0.01, label='typical_p') + shared.gradio['min_p'] = gr.Slider(0.0, 1.0, value=generate_params['min_p'], step=0.01, label='min_p') shared.gradio['repetition_penalty'] = gr.Slider(1.0, 1.5, value=generate_params['repetition_penalty'], step=0.01, label='repetition_penalty') shared.gradio['frequency_penalty'] = gr.Slider(0, 2, value=generate_params['frequency_penalty'], step=0.05, label='frequency_penalty') shared.gradio['presence_penalty'] = gr.Slider(0, 2, value=generate_params['presence_penalty'], step=0.05, label='presence_penalty') @@ -69,7 +70,6 @@ def create_ui(default_preset): with gr.Row(): with gr.Column(): - shared.gradio['min_p'] = gr.Slider(0.0, 1.0, value=generate_params['min_p'], step=0.01, label='min_p') shared.gradio['tfs'] = gr.Slider(0.0, 1.0, value=generate_params['tfs'], step=0.01, label='tfs') shared.gradio['top_a'] = gr.Slider(0.0, 1.0, value=generate_params['top_a'], step=0.01, label='top_a') shared.gradio['smoothing_factor'] = gr.Slider(0.0, 10.0, value=generate_params['smoothing_factor'], step=0.01, label='smoothing_factor', info='Activates Quadratic Sampling.') diff --git a/presets/min_p.yaml b/presets/min_p.yaml new file mode 100644 index 00000000..b8ebc95f --- /dev/null +++ b/presets/min_p.yaml @@ -0,0 +1 @@ +min_p: 0.05 diff --git a/settings-template.yaml b/settings-template.yaml index 31a0f614..a89b6282 100644 --- a/settings-template.yaml +++ b/settings-template.yaml @@ -5,7 +5,7 @@ mode: chat chat_style: cai-chat prompt-default: QA prompt-notebook: QA -preset: simple-1 +preset: min_p max_new_tokens: 512 max_new_tokens_min: 1 max_new_tokens_max: 4096