diff --git a/public/index.html b/public/index.html index d67c78a71..3e430b56e 100644 --- a/public/index.html +++ b/public/index.html @@ -1272,6 +1272,45 @@ + +
+

+ + +
+
+

+
+
+ Multiplier + + +
+
+ Base + + +
+
+ Allowed Length + + +
+
+ Penalty Range + + +
+
+
+
+ Sequence Breakers +
+
+ +
+
+

diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 0e647269c..14b8b96e9 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -678,6 +678,8 @@ async function CreateZenSliders(elmnt) { sliderID == 'top_k' || sliderID == 'mirostat_mode_kobold' || sliderID == 'rep_pen_range' || + sliderID == 'dry_allowed_length_textgenerationwebui' || + sliderID == 'dry_penalty_last_n_textgenerationwebui' || sliderID == 'max_tokens_second_textgenerationwebui') { decimals = 0; } @@ -685,7 +687,9 @@ async function CreateZenSliders(elmnt) { sliderID == 'max_temp_textgenerationwebui' || sliderID == 'dynatemp_exponent_textgenerationwebui' || sliderID == 'smoothing_curve_textgenerationwebui' || - sliderID == 'smoothing_factor_textgenerationwebui') { + sliderID == 'smoothing_factor_textgenerationwebui' || + sliderID == 'dry_multiplier_textgenerationwebui' || + sliderID == 'dry_base_textgenerationwebui') { decimals = 2; } if (sliderID == 'eta_cutoff_textgenerationwebui' || @@ -746,6 +750,7 @@ async function CreateZenSliders(elmnt) { sliderID == 'rep_pen_slope' || sliderID == 'smoothing_factor_textgenerationwebui' || sliderID == 'smoothing_curve_textgenerationwebui' || + sliderID == 'dry_multiplier_textgenerationwebui' || sliderID == 'min_length_textgenerationwebui') { offVal = 0; } @@ -1754,11 +1759,21 @@ function loadMaxContextUnlocked() { } function switchMaxContextSize() { - const elements = [$('#max_context'), $('#max_context_counter'), $('#rep_pen_range'), $('#rep_pen_range_counter'), $('#rep_pen_range_textgenerationwebui'), $('#rep_pen_range_counter_textgenerationwebui')]; + const elements = [ + $('#max_context'), + $('#max_context_counter'), + $('#rep_pen_range'), + $('#rep_pen_range_counter'), + $('#rep_pen_range_textgenerationwebui'), + $('#rep_pen_range_counter_textgenerationwebui'), + $('#dry_penalty_last_n_textgenerationwebui'), + $('#dry_penalty_last_n_counter_textgenerationwebui'), + ]; const maxValue = power_user.max_context_unlocked ? MAX_CONTEXT_UNLOCKED : MAX_CONTEXT_DEFAULT; const minValue = power_user.max_context_unlocked ? maxContextMin : maxContextMin; const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : maxContextStep; $('#rep_pen_range_textgenerationwebui_zenslider').remove(); //unsure why, but this is necessary. + $('#dry_penalty_last_n_textgenerationwebui_zenslider').remove(); for (const element of elements) { const id = element.attr('id'); element.attr('max', maxValue); @@ -1787,6 +1802,8 @@ function switchMaxContextSize() { CreateZenSliders($('#max_context')); $('#rep_pen_range_textgenerationwebui_zenslider').remove(); CreateZenSliders($('#rep_pen_range_textgenerationwebui')); + $('#dry_penalty_last_n_textgenerationwebui_zenslider').remove(); + CreateZenSliders($('#dry_penalty_last_n_textgenerationwebui')); } } diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 8b7a438d6..bb2caab0f 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -116,6 +116,11 @@ const settings = { dynatemp_exponent: 1.0, smoothing_factor: 0.0, smoothing_curve: 1.0, + dry_allowed_length: 2, + dry_multiplier: 0.0, + dry_base: 1.75, + dry_sequence_breakers: '["\\n", ":", "\\"", "*"]', + dry_penalty_last_n: 0, max_tokens_second: 0, seed: -1, preset: 'Default', @@ -190,6 +195,11 @@ export const setting_names = [ 'dynatemp_exponent', 'smoothing_factor', 'smoothing_curve', + 'dry_allowed_length', + 'dry_multiplier', + 'dry_base', + 'dry_sequence_breakers', + 'dry_penalty_last_n', 'max_tokens_second', 'encoder_rep_pen', 'freq_pen', @@ -665,6 +675,10 @@ jQuery(function () { 'guidance_scale_textgenerationwebui': 1, 'smoothing_factor_textgenerationwebui': 0, 'smoothing_curve_textgenerationwebui': 1, + 'dry_allowed_length_textgenerationwebui': 2, + 'dry_multiplier_textgenerationwebui': 0, + 'dry_base_textgenerationwebui': 1.75, + 'dry_penalty_last_n_textgenerationwebui': 0, }; for (const [id, value] of Object.entries(inputs)) { @@ -1028,6 +1042,11 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, 'dynatemp_exponent': settings.dynatemp ? settings.dynatemp_exponent : undefined, 'smoothing_factor': settings.smoothing_factor, 'smoothing_curve': settings.smoothing_curve, + 'dry_allowed_length': settings.dry_allowed_length, + 'dry_multiplier': settings.dry_multiplier, + 'dry_base': settings.dry_base, + 'dry_sequence_breakers': settings.dry_sequence_breakers, + 'dry_penalty_last_n': settings.dry_penalty_last_n, 'max_tokens_second': settings.max_tokens_second, 'sampler_priority': settings.type === OOBA ? settings.sampler_priority : undefined, 'samplers': settings.type === LLAMACPP ? settings.samplers : undefined,