From 4f67e9f38b919dd49009a82c6db1ae1af701726a Mon Sep 17 00:00:00 2001 From: kingbri Date: Wed, 25 Oct 2023 15:21:49 -0400 Subject: [PATCH] Ooba: Add frequency and presence penalty sliders These options essentially supersede repetition penalty, but since ooba also gives the option, add these new sliders in conjunction with the repetition penalty ones. More testing is needed to find good default values. Signed-off-by: kingbri --- public/index.html | 30 ++++++++++++++++++++++++++++++ public/scripts/textgen-settings.js | 6 ++++++ 2 files changed, 36 insertions(+) diff --git a/public/index.html b/public/index.html index 02bcc1f0f..bd5c12692 100644 --- a/public/index.html +++ b/public/index.html @@ -547,6 +547,36 @@ +
+
+ Frequency Penalty +
+
+
+ +
+
+
+ select +
+
+
+
+
+
+ Presence Penalty +
+
+
+ +
+
+
+ select +
+
+
+
No Repeat Ngram Size diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 4dcfe091c..9d9e9e5bc 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -44,6 +44,8 @@ const textgenerationwebui_settings = { length_penalty: 1, min_length: 0, encoder_rep_pen: 1, + freq_pen: 0, + presence_pen: 0, do_sample: true, early_stopping: false, seed: -1, @@ -87,6 +89,8 @@ const setting_names = [ "length_penalty", "min_length", "encoder_rep_pen", + "freq_pen", + "presence_pen", "do_sample", "early_stopping", "seed", @@ -413,6 +417,8 @@ export function getTextGenGenerationData(finalPrompt, this_amount_gen, isImperso 'repetition_penalty': textgenerationwebui_settings.rep_pen, 'repetition_penalty_range': textgenerationwebui_settings.rep_pen_range, 'encoder_repetition_penalty': textgenerationwebui_settings.encoder_rep_pen, + 'frequency_penalty': textgenerationwebui_settings.freq_pen, + 'presence_penalty': textgenerationwebui_settings.presence_pen, 'top_k': textgenerationwebui_settings.top_k, 'min_length': textgenerationwebui_settings.min_length, 'no_repeat_ngram_size': textgenerationwebui_settings.no_repeat_ngram_size,