Update DynaTemp Sliders

More inline with changes made that will be implemented in KCPP main.
This commit is contained in:
Alexander Abushady 2024-01-05 14:36:39 -05:00
parent d66be24518
commit 224dcc83a1
5 changed files with 18 additions and 52 deletions

View File

@ -1317,24 +1317,13 @@
</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="Helpful tip coming soon."></div>
<div class=" fa-solid fa-circle-info opacity50p " title="Set range to 0 to Deactivate."></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="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">
<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">
</div>
</div>
</div>

View File

@ -31,9 +31,7 @@ export const kai_settings = {
use_default_badwordsids: false,
grammar: '',
seed: -1,
dynatemp: false,
min_temp: 0.1,
max_temp: 2.0,
dynatemp_range: 0,
};
/**
@ -143,9 +141,7 @@ export function getKoboldGenerationData(finalPrompt, settings, maxLength, maxCon
use_default_badwordsids: (kai_flags.can_use_default_badwordsids || isHorde) ? kai_settings.use_default_badwordsids : undefined,
grammar: (kai_flags.can_use_grammar || isHorde) ? substituteParams(kai_settings.grammar) : undefined,
sampler_seed: kai_settings.seed >= 0 ? kai_settings.seed : undefined,
dynatemp: (kai_flags.can_use_dynatemp || isHorde) ? kai_settings.dynatemp : false,
min_temp: (kai_flags.can_use_dynatemp || isHorde) ? kai_settings.min_temp : undefined,
max_temp: (kai_flags.can_use_dynatemp || isHorde) ? kai_settings.max_temp : undefined,
dynatemp_range: (kai_flags.can_use_dynatemp || isHorde) ? kai_settings.dynatemp_range : undefined,
api_server,
};
return generate_data;
@ -313,19 +309,12 @@ const sliders = [
setValue: (val) => { kai_settings.seed = Number(val); },
},
{
name: 'min_temp',
sliderId: '#min_temp_kobold',
counterId: '#min_temp_counter_kobold',
name: 'dynatemp_range',
sliderId: '#dynatemp_range_kobold',
counterId: '#dynatemp_range_counter_kobold',
format: (val) => val,
setValue: (val) => { kai_settings.min_temp = Number(val); },
},
{
name: 'max_temp',
sliderId: '#max_temp_kobold',
counterId: '#max_temp_counter_kobold',
format: (val) => val,
setValue: (val) => { kai_settings.max_temp = Number(val); },
},
];
export function setKoboldFlags(koboldUnitedVersion, koboldCppVersion) {

View File

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

View File

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

View File

@ -901,12 +901,8 @@ export interface ModelGenerationInputKobold {
min_p?: number;
/** Typical sampling value. */
typical?: number;
/** DynaTemp sampling activataion. */
dynatemp?: boolean;
/** DynaTemp minimum temperature value. */
min_temp?: number;
/** DynaTemp maximum temperature value. */
max_temp?: number;
/** DynaTemp sampling range value. */
dynatemp_range?: number;
/** Array of integers representing the sampler order to be used */
sample_order?: number[];
}