Skip to content

Commit

Permalink
Add a simple min_p preset, make it the default (oobabooga#5836)
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga authored and PoetOnTheRun committed Oct 22, 2024
1 parent 0455e34 commit 8ad4582
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'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,
Expand Down
2 changes: 1 addition & 1 deletion modules/ui_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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.')
Expand Down
1 change: 1 addition & 0 deletions presets/min_p.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
min_p: 0.05
2 changes: 1 addition & 1 deletion settings-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ad4582

Please sign in to comment.