added xtc parameter for ooba
| @@ -1291,6 +1291,26 @@ | ||
| 1291 | 1291 | </div> |
| 1292 | 1292 | </div> |
| 1293 | 1293 | </div> |
| 1294 | + | |
| 1295 | + <div data-newbie-hidden data-tg-type="ooba" id="xtc_block" class="wide100p"> | |
| 1296 | + <h4 class="wide100p textAlignCenter"> | |
| 1297 | + <label data-i18n="XTC Parameters">XTC Parameters</label> | |
| 1298 | + <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]XTC_Parameters_desc" title="XTC (eXtreme Tail Cutting) parameters for controlling token sampling"></div> | |
| 1299 | + </h4> | |
| 1300 | + <div class="flex-container flexFlowRow gap10px flexShrink"> | |
| 1301 | + <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> | |
| 1302 | + <small data-i18n="XTC Threshold">XTC Threshold</small> | |
| 1303 | + <input class="neo-range-slider" type="range" id="xtc_threshold_textgenerationwebui" name="volume" min="0" max="1" step="0.01" /> | |
| 1304 | + <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="xtc_threshold_textgenerationwebui" id="xtc_threshold_counter_textgenerationwebui"> | |
| 1305 | + </div> | |
| 1306 | + <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> | |
| 1307 | + <small data-i18n="XTC Probability">XTC Probability</small> | |
| 1308 | + <input class="neo-range-slider" type="range" id="xtc_probability_textgenerationwebui" name="volume" min="0" max="1" step="0.01" /> | |
| 1309 | + <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="xtc_probability_textgenerationwebui" id="xtc_probability_counter_textgenerationwebui"> | |
| 1310 | + </div> | |
| 1311 | + </div> | |
| 1312 | + </div> | |
| 1313 | + | |
| 1294 | 1314 | <!-- Enable for llama.cpp when the PR is merged: https://github.com/ggerganov/llama.cpp/pull/6839 --> |
| 1295 | 1315 | <div data-newbie-hidden data-tg-type="ooba, koboldcpp" id="dryBlock" class="wide100p"> |
| 1296 | 1316 | <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"> |
| @@ -1640,6 +1660,7 @@ | ||
| 1640 | 1660 | <div data-name="top_a" draggable="true"><span>Top A</span><small></small></div> |
| 1641 | 1661 | <div data-name="min_p" draggable="true"><span>Min P</span><small></small></div> |
| 1642 | 1662 | <div data-name="mirostat" draggable="true"><span>Mirostat</span><small></small></div> |
| 1663 | + <div data-name="xtc" draggable="true"><span>XTC</span><small></small></div> | |
| 1643 | 1664 | </div> |
| 1644 | 1665 | <div id="textgenerationwebui_default_order" class="menu_button menu_button_icon"> |
| 1645 | 1666 | <span data-i18n="Load default order">Load default order</span> |
| @@ -704,6 +704,21 @@ async function CreateZenSliders(elmnt) { | ||
| 704 | 704 | sliderID == 'dry_base_textgenerationwebui') { |
| 705 | 705 | decimals = 2; |
| 706 | 706 | } |
| 707 | + | |
| 708 | + if (sliderID == 'xtc_threshold_textgenerationwebui') { | |
| 709 | + numSteps = 100; | |
| 710 | + decimals = 2; | |
| 711 | + sliderMin = 0; | |
| 712 | + sliderMax = 1; | |
| 713 | + stepScale = 0.01; | |
| 714 | + } | |
| 715 | + if (sliderID == 'xtc_probability_textgenerationwebui') { | |
| 716 | + numSteps = 100; | |
| 717 | + decimals = 2; | |
| 718 | + sliderMin = 0; | |
| 719 | + sliderMax = 1; | |
| 720 | + stepScale = 0.01; | |
| 721 | + } | |
| 707 | 722 | if (sliderID == 'eta_cutoff_textgenerationwebui' || |
| 708 | 723 | sliderID == 'epsilon_cutoff_textgenerationwebui') { |
| 709 | 724 | numSteps = 50; |
| @@ -80,6 +80,7 @@ const OOBA_DEFAULT_ORDER = [ | ||
| 80 | 80 | 'top_a', |
| 81 | 81 | 'min_p', |
| 82 | 82 | 'mirostat', |
| 83 | + "xtc" | |
| 83 | 84 | ]; |
| 84 | 85 | const BIAS_KEY = '#textgenerationwebui_api-settings'; |
| 85 | 86 | |
| @@ -188,6 +189,8 @@ const settings = { | ||
| 188 | 189 | custom_model: '', |
| 189 | 190 | bypass_status_check: false, |
| 190 | 191 | openrouter_allow_fallbacks: true, |
| 192 | + xtc_threshold: 0.1, | |
| 193 | + xtc_probability: 0, | |
| 191 | 194 | }; |
| 192 | 195 | |
| 193 | 196 | export let textgenerationwebui_banned_in_macros = []; |
| @@ -263,6 +266,8 @@ export const setting_names = [ | ||
| 263 | 266 | 'custom_model', |
| 264 | 267 | 'bypass_status_check', |
| 265 | 268 | 'openrouter_allow_fallbacks', |
| 269 | + 'xtc_threshold', | |
| 270 | + 'xtc_probability', | |
| 266 | 271 | ]; |
| 267 | 272 | |
| 268 | 273 | const DYNATEMP_BLOCK = document.getElementById('dynatemp_block_ooba'); |
| @@ -718,6 +723,8 @@ jQuery(function () { | ||
| 718 | 723 | 'dry_multiplier_textgenerationwebui': 0, |
| 719 | 724 | 'dry_base_textgenerationwebui': 1.75, |
| 720 | 725 | 'dry_penalty_last_n_textgenerationwebui': 0, |
| 726 | + 'xtc_threshold_textgenerationwebui': 0.1, | |
| 727 | + 'xtc_probability_textgenerationwebui': 0 | |
| 721 | 728 | }; |
| 722 | 729 | |
| 723 | 730 | for (const [id, value] of Object.entries(inputs)) { |
| @@ -1128,6 +1135,8 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, | ||
| 1128 | 1135 | 'api_server': getTextGenServer(), |
| 1129 | 1136 | 'legacy_api': settings.legacy_api && (settings.type === OOBA || settings.type === APHRODITE), |
| 1130 | 1137 | 'sampler_order': settings.type === textgen_types.KOBOLDCPP ? settings.sampler_order : undefined, |
| 1138 | + 'xtc_threshold': settings.type === OOBA ? settings.xtc_threshold : undefined, | |
| 1139 | + 'xtc_probability': settings.type === OOBA ? settings.xtc_probability : undefined, | |
| 1131 | 1140 | }; |
| 1132 | 1141 | const nonAphroditeParams = { |
| 1133 | 1142 | 'rep_pen': settings.rep_pen, |