Add XTC for koboldcpp

This commit is contained in:
Cohee
2024-08-31 20:18:51 +03:00
parent 4dbed09505
commit ae2d0f04ed
3 changed files with 5 additions and 21 deletions

View File

@ -1279,7 +1279,7 @@
</div>
</div>
<div data-newbie-hidden data-tg-type="ooba" id="xtc_block" class="wide100p">
<div data-newbie-hidden data-tg-type="koboldcpp" id="xtc_block" class="wide100p">
<h4 class="wide100p textAlignCenter">
<label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
<a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@ -1289,8 +1289,8 @@
<div class="flex-container flexFlowRow gap10px flexShrink">
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
<small data-i18n="Threshold">Threshold</small>
<input class="neo-range-slider" type="range" id="xtc_threshold_textgenerationwebui" name="volume" min="0" max="1" step="0.01" />
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="xtc_threshold_textgenerationwebui" id="xtc_threshold_counter_textgenerationwebui">
<input class="neo-range-slider" type="range" id="xtc_threshold_textgenerationwebui" name="volume" min="0" max="0.5" step="0.01" />
<input class="neo-range-input" type="number" min="0" max="0.5" step="0.01" data-for="xtc_threshold_textgenerationwebui" id="xtc_threshold_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
<small data-i18n="Probability">Probability</small>
@ -1649,7 +1649,6 @@
<div data-name="top_a" draggable="true"><span>Top A</span><small></small></div>
<div data-name="min_p" draggable="true"><span>Min P</span><small></small></div>
<div data-name="mirostat" draggable="true"><span>Mirostat</span><small></small></div>
<div data-name="xtc" draggable="true"><span>XTC</span><small></small></div>
</div>
<div id="textgenerationwebui_default_order" class="menu_button menu_button_icon">
<span data-i18n="Load default order">Load default order</span>

View File

@ -640,20 +640,6 @@ async function CreateZenSliders(elmnt) {
decimals = 2;
}
if (sliderID == 'xtc_threshold_textgenerationwebui') {
numSteps = 100;
decimals = 2;
sliderMin = 0;
sliderMax = 1;
stepScale = 0.01;
}
if (sliderID == 'xtc_probability_textgenerationwebui') {
numSteps = 100;
decimals = 2;
sliderMin = 0;
sliderMax = 1;
stepScale = 0.01;
}
if (sliderID == 'eta_cutoff_textgenerationwebui' ||
sliderID == 'epsilon_cutoff_textgenerationwebui') {
numSteps = 50;

View File

@ -80,7 +80,6 @@ const OOBA_DEFAULT_ORDER = [
'top_a',
'min_p',
'mirostat',
'xtc',
];
const BIAS_KEY = '#textgenerationwebui_api-settings';
@ -1163,8 +1162,8 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
'api_server': getTextGenServer(),
'legacy_api': settings.legacy_api && (settings.type === OOBA || settings.type === APHRODITE),
'sampler_order': settings.type === textgen_types.KOBOLDCPP ? settings.sampler_order : undefined,
'xtc_threshold': settings.type === OOBA ? settings.xtc_threshold : undefined,
'xtc_probability': settings.type === OOBA ? settings.xtc_probability : undefined,
'xtc_threshold': settings.xtc_threshold,
'xtc_probability': settings.xtc_probability,
};
const nonAphroditeParams = {
'rep_pen': settings.rep_pen,