Merge pull request #1285 from bdashore3/staging

Add freq pen and presence pen for ooba
This commit is contained in:
Cohee 2023-10-25 22:38:52 +03:00 committed by GitHub
commit 864ac3927f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -547,6 +547,36 @@
</div> </div>
</div> </div>
</div> </div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Frequency Penalty">
Frequency Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="freq_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
</div>
<div class="range-block-counter">
<div contenteditable="true" data-for="freq_pen_textgenerationwebui" id="freq_pen_counter_textgenerationwebui">
select
</div>
</div>
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Presence Penalty">
Presence Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="presence_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
</div>
<div class="range-block-counter">
<div contenteditable="true" data-for="presence_pen_textgenerationwebui" id="presence_pen_counter_textgenerationwebui">
select
</div>
</div>
</div>
</div>
<div data-newbie-hidden class="range-block"> <div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="No Repeat Ngram Size"> <div class="range-block-title" data-i18n="No Repeat Ngram Size">
No Repeat Ngram Size No Repeat Ngram Size

View File

@ -44,6 +44,8 @@ const textgenerationwebui_settings = {
length_penalty: 1, length_penalty: 1,
min_length: 0, min_length: 0,
encoder_rep_pen: 1, encoder_rep_pen: 1,
freq_pen: 0,
presence_pen: 0,
do_sample: true, do_sample: true,
early_stopping: false, early_stopping: false,
seed: -1, seed: -1,
@ -87,6 +89,8 @@ const setting_names = [
"length_penalty", "length_penalty",
"min_length", "min_length",
"encoder_rep_pen", "encoder_rep_pen",
"freq_pen",
"presence_pen",
"do_sample", "do_sample",
"early_stopping", "early_stopping",
"seed", "seed",
@ -413,6 +417,8 @@ export function getTextGenGenerationData(finalPrompt, this_amount_gen, isImperso
'repetition_penalty': textgenerationwebui_settings.rep_pen, 'repetition_penalty': textgenerationwebui_settings.rep_pen,
'repetition_penalty_range': textgenerationwebui_settings.rep_pen_range, 'repetition_penalty_range': textgenerationwebui_settings.rep_pen_range,
'encoder_repetition_penalty': textgenerationwebui_settings.encoder_rep_pen, '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, 'top_k': textgenerationwebui_settings.top_k,
'min_length': textgenerationwebui_settings.min_length, 'min_length': textgenerationwebui_settings.min_length,
'no_repeat_ngram_size': textgenerationwebui_settings.no_repeat_ngram_size, 'no_repeat_ngram_size': textgenerationwebui_settings.no_repeat_ngram_size,