Merge pull request #2741 from SillyTavern/xtc-koboldcpp

XTC for koboldcpp
This commit is contained in:
Cohee 2024-08-31 20:28:22 +03:00 committed by GitHub
commit e690a87294
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View File

@ -1278,6 +1278,28 @@
</div>
</div>
</div>
<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">
<div class=" fa-solid fa-circle-info opacity50p"></div>
</a>
</h4>
<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="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>
<input class="neo-range-slider" type="range" id="xtc_probability_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_probability_textgenerationwebui" id="xtc_probability_counter_textgenerationwebui">
</div>
</div>
</div>
<!-- Enable for llama.cpp when the PR is merged: https://github.com/ggerganov/llama.cpp/pull/6839 -->
<div data-newbie-hidden data-tg-type="ooba, koboldcpp" id="dryBlock" class="wide100p">
<h4 class="wide100p textAlignCenter" title="DRY penalizes tokens that would extend the end of the input into a sequence that has previously occurred in the input. Set multiplier to 0 to disable." data-i18n="[title]DRY_Repetition_Penalty_desc">

View File

@ -188,6 +188,8 @@ const settings = {
custom_model: '',
bypass_status_check: false,
openrouter_allow_fallbacks: true,
xtc_threshold: 0.1,
xtc_probability: 0,
};
export let textgenerationwebui_banned_in_macros = [];
@ -263,6 +265,8 @@ export const setting_names = [
'custom_model',
'bypass_status_check',
'openrouter_allow_fallbacks',
'xtc_threshold',
'xtc_probability',
];
const DYNATEMP_BLOCK = document.getElementById('dynatemp_block_ooba');
@ -718,6 +722,8 @@ jQuery(function () {
'dry_multiplier_textgenerationwebui': 0,
'dry_base_textgenerationwebui': 1.75,
'dry_penalty_last_n_textgenerationwebui': 0,
'xtc_threshold_textgenerationwebui': 0.1,
'xtc_probability_textgenerationwebui': 0,
};
for (const [id, value] of Object.entries(inputs)) {
@ -1156,6 +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.xtc_threshold,
'xtc_probability': settings.xtc_probability,
};
const nonAphroditeParams = {
'rep_pen': settings.rep_pen,