Add rep_pen_slope control for koboldcpp

This commit is contained in:
Cohee 2024-06-05 22:05:41 +03:00
parent 0a3e91287d
commit ff680f46cc
3 changed files with 9 additions and 0 deletions

View File

@ -1228,6 +1228,11 @@
<input class="neo-range-slider" type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="-1" max="8192" step="1"> <input class="neo-range-slider" type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="-1" max="8192" step="1">
<input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui"> <input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
</div> </div>
<div data-tg-type="koboldcpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
<small data-i18n="Rep. Pen. Slope">Rep Pen Slope</small>
<input class="neo-range-slider" type="range" id="rep_pen_slope_textgenerationwebui" name="volume" min="0" max="10" step="0.01">
<input class="neo-range-input" type="number" min="0" max="10" step="0.01" data-for="rep_pen_slope_textgenerationwebui" id="rep_pen_slope_counter_textgenerationwebui">
</div>
<div data-tg-type="tabby" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> <div data-tg-type="tabby" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
<small data-i18n="rep.pen decay">Rep Pen Decay</small> <small data-i18n="rep.pen decay">Rep Pen Decay</small>
<input class="neo-range-slider" type="range" id="rep_pen_decay_textgenerationwebui" name="volume" min="-1" max="8192" step="1"> <input class="neo-range-slider" type="range" id="rep_pen_decay_textgenerationwebui" name="volume" min="-1" max="8192" step="1">

View File

@ -771,6 +771,7 @@ async function CreateZenSliders(elmnt) {
sliderID == 'max_temp_textgenerationwebui' || sliderID == 'max_temp_textgenerationwebui' ||
sliderID == 'dynatemp_exponent_textgenerationwebui' || sliderID == 'dynatemp_exponent_textgenerationwebui' ||
sliderID == 'guidance_scale_textgenerationwebui' || sliderID == 'guidance_scale_textgenerationwebui' ||
sliderID == 'rep_pen_slope_textgenerationwebui' ||
sliderID == 'guidance_scale') { sliderID == 'guidance_scale') {
offVal = 1; offVal = 1;
} }

View File

@ -101,6 +101,7 @@ const settings = {
rep_pen: 1.2, rep_pen: 1.2,
rep_pen_range: 0, rep_pen_range: 0,
rep_pen_decay: 0, rep_pen_decay: 0,
rep_pen_slope: 1,
no_repeat_ngram_size: 0, no_repeat_ngram_size: 0,
penalty_alpha: 0, penalty_alpha: 0,
num_beams: 1, num_beams: 1,
@ -180,6 +181,7 @@ export const setting_names = [
'rep_pen', 'rep_pen',
'rep_pen_range', 'rep_pen_range',
'rep_pen_decay', 'rep_pen_decay',
'rep_pen_slope',
'no_repeat_ngram_size', 'no_repeat_ngram_size',
'top_k', 'top_k',
'top_p', 'top_p',
@ -1105,6 +1107,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'mirostat': settings.mirostat_mode, 'mirostat': settings.mirostat_mode,
'ignore_eos': settings.ban_eos_token, 'ignore_eos': settings.ban_eos_token,
'n_probs': power_user.request_token_probabilities ? 10 : undefined, 'n_probs': power_user.request_token_probabilities ? 10 : undefined,
'rep_pen_slope': settings.rep_pen_slope,
}; };
const vllmParams = { const vllmParams = {
'n': canMultiSwipe ? settings.n : 1, 'n': canMultiSwipe ? settings.n : 1,