Implement "except" mode for type-specific controls in settings
| @@ -1235,7 +1235,8 @@ | ||
| 1235 | 1235 | <input class="neo-range-slider" type="range" id="temp_textgenerationwebui" name="volume" min="0.0" max="5.0" step="0.01" x-setting-id="temp"> |
| 1236 | 1236 | <input class="neo-range-input" type="number" min="0.0" max="5.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui"> |
| 1237 | 1237 | </div> |
| 1238 | - <div class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> | |
| 1238 | + <!-- Note: "except" mode = show for all BUT types in data-tg-type --> | |
| 1239 | + <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> | |
| 1239 | 1240 | <small> |
| 1240 | 1241 | <span data-i18n="Top K">Top K</span> |
| 1241 | 1242 | <div class="fa-solid fa-circle-info opacity50p" title="Top K sets a maximum amount of top tokens that can be chosen from. E.g Top K is 20, this means only the 20 highest ranking tokens will be kept (regardless of their probabilities being diverse or limited). Set to 0 (or -1, depending on your backend) to disable." data-i18n="[title]Top_K_desc"></div> |
| @@ -1251,7 +1252,7 @@ | ||
| 1251 | 1252 | <input class="neo-range-slider" type="range" id="top_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01"> |
| 1252 | 1253 | <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_p_textgenerationwebui" id="top_p_counter_textgenerationwebui"> |
| 1253 | 1254 | </div> |
| 1254 | 1255 | <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> |
| 1255 | 1256 | <small> |
| 1256 | 1257 | <span data-i18n="Typical P">Typical P</span> |
| 1257 | 1258 | <div class="fa-solid fa-circle-info opacity50p" title="Typical P Sampling prioritizes tokens based on their deviation from the average entropy of the set. It maintains tokens whose cumulative probability is close to a predefined threshold (e.g., 0.5), emphasizing those with average information content. Set to 1.0 to disable." data-i18n="[title]Typical_P_desc"></div> |
| @@ -1259,7 +1260,7 @@ | ||
| 1259 | 1260 | <input class="neo-range-slider" type="range" id="typical_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01"> |
| 1260 | 1261 | <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="typical_p_textgenerationwebui" id="typical_p_counter_textgenerationwebui"> |
| 1261 | 1262 | </div> |
| 1262 | 1263 | <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> |
| 1263 | 1264 | <small> |
| 1264 | 1265 | <span data-i18n="Min P">Min P</span> |
| 1265 | 1266 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Min_P_desc" title="Min P sets a base minimum probability. This is scaled according to the top token's probability. E.g If Top token is 80% probability, and Min P is 0.1, only tokens higher than 8% would be considered. Set to 0 to disable."></div> |
| @@ -1267,7 +1268,7 @@ | ||
| 1267 | 1268 | <input class="neo-range-slider" type="range" id="min_p_textgenerationwebui" name="volume" min="0" max="1" step="0.001"> |
| 1268 | 1269 | <input class="neo-range-input" type="number" min="0" max="1" step="0.001" data-for="min_p_textgenerationwebui" id="min_p_counter_textgenerationwebui"> |
| 1269 | 1270 | </div> |
| 1270 | 1271 | <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> |
| 1271 | 1272 | <small> |
| 1272 | 1273 | <span data-i18n="Top A">Top A</span> |
| 1273 | 1274 | <div class="fa-solid fa-circle-info opacity50p" title="Top A sets a threshold for token selection based on the square of the highest token probability. E.g if the Top-A value is 0.2 and the top token's probability is 50%, tokens with probabilities below 5% (0.2 * 0.5^2) are excluded. Set to 0 to disable." data-i18n="[title]Top_A_desc"></div> |
| @@ -1275,7 +1276,7 @@ | ||
| 1275 | 1276 | <input class="neo-range-slider" type="range" id="top_a_textgenerationwebui" name="volume" min="0" max="1" step="0.01"> |
| 1276 | 1277 | <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_a_textgenerationwebui" id="top_a_counter_textgenerationwebui"> |
| 1277 | 1278 | </div> |
| 1278 | 1279 | <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> |
| 1279 | 1280 | <small> |
| 1280 | 1281 | <span data-i18n="TFS">TFS</span> |
| 1281 | 1282 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Tail_Free_Sampling_desc" title="Tail-Free Sampling (TFS) searches for a tail of low-probability tokens in the distribution, by analyzing the rate of change in token probabilities using derivatives. It retains tokens up to a threshold (e.g., 0.3) based on the normalized second derivative. The closer to 0, the more discarded tokens. Set to 1.0 to disable."></div> |
| @@ -1307,7 +1308,7 @@ | ||
| 1307 | 1308 | <input class="neo-range-slider" type="range" id="eta_cutoff_textgenerationwebui" name="volume" min="0" max="20" step="0.01"> |
| 1308 | 1309 | <input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="eta_cutoff_textgenerationwebui" id="eta_cutoff_counter_textgenerationwebui"> |
| 1309 | 1310 | </div> |
| 1310 | 1311 | <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0"> |
| 1311 | 1312 | <small data-i18n="rep.pen">Repetition Penalty</small> |
| 1312 | 1313 | <input class="neo-range-slider" type="range" id="rep_pen_textgenerationwebui" name="volume" min="1" max="3" step="0.01"> |
| 1313 | 1314 | <input class="neo-range-input" type="number" min="1" max="3" step="0.01" data-for="rep_pen_textgenerationwebui" id="rep_pen_counter_textgenerationwebui"> |
| @@ -1569,7 +1570,7 @@ | ||
| 1569 | 1570 | <small data-i18n="Ignore EOS Token">Ignore EOS Token</small> |
| 1570 | 1571 | <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Ignore the EOS Token even if it generates." title="Ignore the EOS Token even if it generates."></div> |
| 1571 | 1572 | </label> |
| 1572 | 1573 | <label data-tg-type-mode="except" data-tg-type="generic" class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui"> |
| 1573 | 1574 | <input type="checkbox" id="skip_special_tokens_textgenerationwebui" /> |
| 1574 | 1575 | <small data-i18n="Skip Special Tokens">Skip Special Tokens</small> |
| 1575 | 1576 | </label> |
| @@ -1594,14 +1595,14 @@ | ||
| 1594 | 1595 | </label> |
| 1595 | 1596 | </div> |
| 1596 | 1597 | </div> |
| 1597 | 1598 | <div data-tg-type="mancer, ooba, koboldcpp, vllm, aphrodite, llamacpp, ollama, infermaticai, huggingface, generic" class="flex-container flexFlowColumn alignitemscenter flexBasis48p flexGrow flexShrink gap0"> |
| 1598 | 1599 | <label> |
| 1599 | 1600 | <small data-i18n="Seed">Seed</small> |
| 1600 | 1601 | <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Seed_desc" title="A random seed to use for deterministic and reproducable outputs. Set to -1 to use a random seed."></div> |
| 1601 | 1602 | </label> |
| 1602 | 1603 | <input type="number" id="seed_textgenerationwebui" class="text_pole textAlignCenter" min="-1" value="-1" /> |
| 1603 | 1604 | </div> |
| 1604 | 1605 | <div data-tg-type-mode="except" data-tg-type="generic" id="banned_tokens_block_ooba" class="wide100p"> |
| 1605 | 1606 | <hr class="width100p"> |
| 1606 | 1607 | <h4 class="range-block-title justifyCenter"> |
| 1607 | 1608 | <span data-i18n="Banned Tokens">Banned Tokens/Strings</span> |
| @@ -838,7 +838,14 @@ jQuery(function () { | ||
| 838 | 838 | |
| 839 | 839 | function showTypeSpecificControls(type) { |
| 840 | 840 | $('[data-tg-type]').each(function () { |
| 841 | + const mode = String($(this).attr('data-tg-type-mode') ?? '').toLowerCase().trim(); | |
| 841 | 842 | const tgTypes = $(this).attr('data-tg-type').split(',').map(x => x.trim()); |
| 843 | + | |
| 844 | + if (mode === 'except') { | |
| 845 | + $(this)[tgTypes.includes(type) ? 'hide' : 'show'](); | |
| 846 | + return; | |
| 847 | + } | |
| 848 | + | |
| 842 | 849 | for (const tgType of tgTypes) { |
| 843 | 850 | if (tgType === type || tgType == 'all') { |
| 844 | 851 | $(this).show(); |