DynaTemp UI v3

Backend bros won't play along now we gotta make them hold hands.
This commit is contained in:
Alexander Abushady 2024-01-08 22:20:27 -05:00
parent ead0aa65ff
commit b334acec23
3 changed files with 31 additions and 11 deletions

View File

@ -1317,13 +1317,24 @@
</div>
<div data-newbie-hidden name="dynaTempBlock" class="wide100p">
<h4 class="wide100p textAlignCenter" data-i18n="DynaTemp">DynaTemp
<div class=" fa-solid fa-circle-info opacity50p " title="Set range to 0 to Deactivate."></div>
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</h4>
<div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">
<div class="">
<label class="checkbox_label" for="dynatemp_textgenerationwebui">
<input type="checkbox" id="dynatemp_textgenerationwebui" />
<small data-i18n="dynatemp">Activate</small>
</label>
</div>
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
<small data-i18n="DynaTemp Range">DynaTemp Range</small>
<input class="neo-range-slider" type="range" id="dynatemp_range_textgenerationwebui" name="volume" min="0" max="2.0" step="0.1" />
<input class="neo-range-input" type="number" min="0" max="2.0" step="0.1" data-for="dynatemp_range_textgenerationwebui" id="dynatemp_range_counter_textgenerationwebui">
<small data-i18n="Min Temp">Min Temp</small>
<input class="neo-range-slider" type="range" id="min_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.1" />
<input class="neo-range-input" type="number" min="0" max="5" step="0.1" data-for="min_temp_textgenerationwebui" id="min_temp_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
<small data-i18n="Max Temp">Max Temp</small>
<input class="neo-range-slider" type="range" id="max_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.1" />
<input class="neo-range-input" type="number" min="0" max="5" step="0.1" data-for="max_temp_textgenerationwebui" id="max_temp_counter_textgenerationwebui">
</div>
</div>
</div>

View File

@ -608,7 +608,8 @@ async function CreateZenSliders(elmnt) {
sliderID == 'rep_pen_range') {
decimals = 0;
}
if (sliderID == 'dynatemp_range_textgenerationwebui') {
if (sliderID == 'min_temp_textgenerationwebui' ||
sliderID == 'max_temp_textgenerationwebui') {
decimals = 2;
}
if (sliderID == 'eta_cutoff_textgenerationwebui' ||
@ -635,13 +636,14 @@ async function CreateZenSliders(elmnt) {
sliderID == 'tfs_textgenerationwebui' ||
sliderID == 'min_p_textgenerationwebui' ||
sliderID == 'temp_textgenerationwebui' ||
sliderID == 'temp' ||
sliderID == 'dynatemp_range_textgenerationwebui') {
sliderID == 'temp') {
numSteps = 20;
}
if (sliderID == 'mirostat_eta_textgenerationwebui' ||
sliderID == 'penalty_alpha_textgenerationwebui' ||
sliderID == 'length_penalty_textgenerationwebui') {
sliderID == 'length_penalty_textgenerationwebui' ||
sliderID == 'min_temp_textgenerationwebui' ||
sliderID == 'max_temp_textgenerationwebui') {
numSteps = 50;
}
//customize off values

View File

@ -79,7 +79,9 @@ const settings = {
presence_pen: 0,
do_sample: true,
early_stopping: false,
dynatemp_range: 0,
dynatemp: false,
min_temp: 0,
max_temp: 2.0,
seed: -1,
preset: 'Default',
add_bos_token: true,
@ -138,7 +140,9 @@ const setting_names = [
'num_beams',
'length_penalty',
'min_length',
'dynatemp_range',
'dynatemp',
'min_temp',
'max_temp',
'encoder_rep_pen',
'freq_pen',
'presence_pen',
@ -720,7 +724,10 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'length_penalty': settings.length_penalty,
'early_stopping': settings.early_stopping,
'add_bos_token': settings.add_bos_token,
'dynatemp_range': settings.dynatemp_range,
'dynatemp': settings.dynatemp,
'dynatemp_low': settings.min_temp,
'dynatemp_high': settings.max_temp,
'dynatemp_range': (settings.min_temp + settings.max_temp) / 2,
'stopping_strings': getStoppingStrings(isImpersonate, isContinue),
'stop': getStoppingStrings(isImpersonate, isContinue),
'truncation_length': max_context,