Add option to keep manually selected samplers on API Type switch (#4692) * Feat - Save and load manually selected samplers per preset * Fix - Sync sampler popup with selected sampler state settings * Fix - Prevent breaking visualization after disabling keep selected samplers * Fix - ESLint errors in samplerSelect.js * Fix - ESLint errors in textgen-settings.js * Docs - Write JSDocs for new methods in textgen-settings.js * Update - Make the reset button work individually per preset * Fix - Trailing whitespace at the end of class selector * Fix - Update tooltip information for force samplers toggle * Fix - Prevent calling isSamplerManualPriorityEnabled a bajillion times * Fix - Unbrick switch from manually-forced to non-manually-forced preset This prevents samplers non controlled by [data-tg-type] from being sent to the shadow realm if they were previously hidden by [data-tg-samplers]. is_preset_switch is just to prevent breaking muscle memmory of users not using force manually selected samplers. * Fix - Load manually selected samplers on connection profile switch Changing preset does not update samplers ONLY IF force manually selection is disabled. Changing API before preset would update the samplers, but using the settings of the previous preset, due to preset being changed AFTER the API. * Fix - Switch API Type controls in the API Connections panel * Fix - ESLint errors in textgen-settings.js * Fix - Update sampler selection only with textgenerationwebui as main API selected * Styles - Change the sampler selection lock button icon to an actual lock. * Fix - Await for sampler selection reset to finish * Update - Normalize function name * Update - Preserve manual sampler selections on preset renaming * Fix - Properly reset sampler manual selections * Update - Ensure selection reset displays API specific samplers * Fix - ESLint errors * Fix - Avoid modifying non-existent data * Update - Move manual sampler control methods to samplerSelect.js * Fix - Break circular file dependency between textgen-settings.js and samplerSelect.js setting_names was unavailable during page load, throwing an error and preventing ST from loading. * Update menu layout * Remove pointless await * Update param naming to camelCase --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

0d9a72becc83556c75dbd536b030ca0c8e46fc79

Leandro Jofré <leandrotomasjofre@gmail.com>

Signed
6 files changed, +301 -80Showing whitespace changes
public/index.html+65 -65
@@ -1246,12 +1246,12 @@
1246 <div class="fa-solid fa-circle-info opacity50p" title="Customize displayed samplers or add custom samplers." data-i18n="[title]Customize displayed samplers or add custom samplers."></div>1246 <div class="fa-solid fa-circle-info opacity50p" title="Customize displayed samplers or add custom samplers." data-i18n="[title]Customize displayed samplers or add custom samplers."></div>
1247 </small>1247 </small>
1248 </div>1248 </div>
1249 <div data-tg-type="mancer, vllm, aphrodite, tabby, infermaticai" class="flex-container flexFlowColumn alignitemscenter flexBasis100p flexGrow flexShrink gap0">1249 <div data-tg-type="mancer, vllm, aphrodite, tabby, infermaticai" data-tg-samplers="n" class="flex-container flexFlowColumn alignitemscenter flexBasis100p flexGrow flexShrink gap0">
1250 <small data-i18n="Multiple swipes per generation">Multiple swipes per generation</small>1250 <small data-i18n="Multiple swipes per generation">Multiple swipes per generation</small>
1251 <input type="number" id="n_textgenerationwebui" class="text_pole textAlignCenter" min="1" value="1" step="1" />1251 <input type="number" id="n_textgenerationwebui" class="text_pole textAlignCenter" min="1" value="1" step="1" />
1252 </div>1252 </div>
1253 <div class="flex-container gap10h5v justifyCenter">1253 <div class="flex-container gap10h5v justifyCenter">
1254 <div class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1254 <div data-tg-samplers="temp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1255 <small>1255 <small>
1256 <span data-i18n="Temperature">Temperature</span>1256 <span data-i18n="Temperature">Temperature</span>
1257 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Temperature controls the randomness in token selection" title="Temperature controls the randomness in token selection:&#13;- low temperature (<1.0) leads to more predictable text, favoring higher probability tokens.&#13;- high temperature (>1.0) increases creativity and diversity in the output by giving lower probability tokens a better chance.&#13;Set to 1.0 for the original probabilities."></div>1257 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Temperature controls the randomness in token selection" title="Temperature controls the randomness in token selection:&#13;- low temperature (<1.0) leads to more predictable text, favoring higher probability tokens.&#13;- high temperature (>1.0) increases creativity and diversity in the output by giving lower probability tokens a better chance.&#13;Set to 1.0 for the original probabilities."></div>
@@ -1260,7 +1260,7 @@
1260 <input class="neo-range-input" type="number" min="0.0" max="5.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">1260 <input class="neo-range-input" type="number" min="0.0" max="5.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">
1261 </div>1261 </div>
1262 <!-- Note: "except" mode = show for all BUT types in data-tg-type -->1262 <!-- Note: "except" mode = show for all BUT types in data-tg-type -->
1263 <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1263 <div data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="top_k" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1264 <small>1264 <small>
1265 <span data-i18n="Top K">Top K</span>1265 <span data-i18n="Top K">Top K</span>
1266 <div class="fa-solid fa-circle-info opacity50p" title="Top K sets a maximum amount of top tokens that can be chosen from.&#13;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).&#13;Set to 0 (or -1, depending on your backend) to disable." data-i18n="[title]Top_K_desc"></div>1266 <div class="fa-solid fa-circle-info opacity50p" title="Top K sets a maximum amount of top tokens that can be chosen from.&#13;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).&#13;Set to 0 (or -1, depending on your backend) to disable." data-i18n="[title]Top_K_desc"></div>
@@ -1268,7 +1268,7 @@
1268 <input class="neo-range-slider" type="range" id="top_k_textgenerationwebui" name="volume" min="-1" max="200" step="1">1268 <input class="neo-range-slider" type="range" id="top_k_textgenerationwebui" name="volume" min="-1" max="200" step="1">
1269 <input class="neo-range-input" type="number" min="-1" max="200" step="1" data-for="top_k_textgenerationwebui" id="top_k_counter_textgenerationwebui">1269 <input class="neo-range-input" type="number" min="-1" max="200" step="1" data-for="top_k_textgenerationwebui" id="top_k_counter_textgenerationwebui">
1270 </div>1270 </div>
1271 <div class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1271 <div data-tg-samplers="top_p" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1272 <small>1272 <small>
1273 <span data-i18n="Top P">Top P</span>1273 <span data-i18n="Top P">Top P</span>
1274 <div class="fa-solid fa-circle-info opacity50p" title="Top P (a.k.a. nucleus sampling) adds up all the top tokens required to add up to the target percentage.&#13;E.g If the Top 2 tokens are both 25%, and Top P is 0.50, only the Top 2 tokens are considered.&#13;Set to 1.0 to disable." data-i18n="[title]Top_P_desc"></div>1274 <div class="fa-solid fa-circle-info opacity50p" title="Top P (a.k.a. nucleus sampling) adds up all the top tokens required to add up to the target percentage.&#13;E.g If the Top 2 tokens are both 25%, and Top P is 0.50, only the Top 2 tokens are considered.&#13;Set to 1.0 to disable." data-i18n="[title]Top_P_desc"></div>
@@ -1276,7 +1276,7 @@
1276 <input class="neo-range-slider" type="range" id="top_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">1276 <input class="neo-range-slider" type="range" id="top_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
1277 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_p_textgenerationwebui" id="top_p_counter_textgenerationwebui">1277 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_p_textgenerationwebui" id="top_p_counter_textgenerationwebui">
1278 </div>1278 </div>
1279 <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1279 <div data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="typical_p" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1280 <small>1280 <small>
1281 <span data-i18n="Typical P">Typical P</span>1281 <span data-i18n="Typical P">Typical P</span>
1282 <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.&#13;It maintains tokens whose cumulative probability is close to a predefined threshold (e.g., 0.5), emphasizing those with average information content.&#13;Set to 1.0 to disable." data-i18n="[title]Typical_P_desc"></div>1282 <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.&#13;It maintains tokens whose cumulative probability is close to a predefined threshold (e.g., 0.5), emphasizing those with average information content.&#13;Set to 1.0 to disable." data-i18n="[title]Typical_P_desc"></div>
@@ -1284,7 +1284,7 @@
1284 <input class="neo-range-slider" type="range" id="typical_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">1284 <input class="neo-range-slider" type="range" id="typical_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
1285 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="typical_p_textgenerationwebui" id="typical_p_counter_textgenerationwebui">1285 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="typical_p_textgenerationwebui" id="typical_p_counter_textgenerationwebui">
1286 </div>1286 </div>
1287 <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1287 <div data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="min_p" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1288 <small>1288 <small>
1289 <span data-i18n="Min P">Min P</span>1289 <span data-i18n="Min P">Min P</span>
1290 <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.&#13;E.g If Top token is 80% probability, and Min P is 0.1, only tokens higher than 8% would be considered.&#13;Set to 0 to disable."></div>1290 <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.&#13;E.g If Top token is 80% probability, and Min P is 0.1, only tokens higher than 8% would be considered.&#13;Set to 0 to disable."></div>
@@ -1292,7 +1292,7 @@
1292 <input class="neo-range-slider" type="range" id="min_p_textgenerationwebui" name="volume" min="0" max="1" step="0.001">1292 <input class="neo-range-slider" type="range" id="min_p_textgenerationwebui" name="volume" min="0" max="1" step="0.001">
1293 <input class="neo-range-input" type="number" min="0" max="1" step="0.001" data-for="min_p_textgenerationwebui" id="min_p_counter_textgenerationwebui">1293 <input class="neo-range-input" type="number" min="0" max="1" step="0.001" data-for="min_p_textgenerationwebui" id="min_p_counter_textgenerationwebui">
1294 </div>1294 </div>
1295 <div data-tg-type-mode="except" data-tg-type="generic,llamacpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1295 <div data-tg-type-mode="except" data-tg-type="generic,llamacpp" data-tg-samplers="top_a" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1296 <small>1296 <small>
1297 <span data-i18n="Top A">Top A</span>1297 <span data-i18n="Top A">Top A</span>
1298 <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.&#13;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.&#13;Set to 0 to disable." data-i18n="[title]Top_A_desc"></div>1298 <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.&#13;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.&#13;Set to 0 to disable." data-i18n="[title]Top_A_desc"></div>
@@ -1300,7 +1300,7 @@
1300 <input class="neo-range-slider" type="range" id="top_a_textgenerationwebui" name="volume" min="0" max="1" step="0.01">1300 <input class="neo-range-slider" type="range" id="top_a_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
1301 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_a_textgenerationwebui" id="top_a_counter_textgenerationwebui">1301 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_a_textgenerationwebui" id="top_a_counter_textgenerationwebui">
1302 </div>1302 </div>
1303 <div data-tg-type-mode="except" data-tg-type="generic,llamacpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1303 <div data-tg-type-mode="except" data-tg-type="generic,llamacpp" data-tg-samplers="tfs" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1304 <small>1304 <small>
1305 <span data-i18n="TFS">TFS</span>1305 <span data-i18n="TFS">TFS</span>
1306 <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,&#13;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.&#13;The closer to 0, the more discarded tokens. Set to 1.0 to disable."></div>1306 <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,&#13;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.&#13;The closer to 0, the more discarded tokens. Set to 1.0 to disable."></div>
@@ -1308,7 +1308,7 @@
1308 <input class="neo-range-slider" type="range" id="tfs_textgenerationwebui" name="volume" min="0" max="1" step="0.001">1308 <input class="neo-range-slider" type="range" id="tfs_textgenerationwebui" name="volume" min="0" max="1" step="0.001">
1309 <input class="neo-range-input" type="number" min="0" max="1" step="0.001" data-for="tfs_textgenerationwebui" id="tfs_counter_textgenerationwebui">1309 <input class="neo-range-input" type="number" min="0" max="1" step="0.001" data-for="tfs_textgenerationwebui" id="tfs_counter_textgenerationwebui">
1310 </div>1310 </div>
1311 <div data-tg-type="ooba,mancer,aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1311 <div data-tg-type="ooba,mancer,aphrodite" data-tg-samplers="epsilon_cutoff" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1312 <small>1312 <small>
1313 <span data-i18n="Epsilon Cutoff">Epsilon Cutoff</span>1313 <span data-i18n="Epsilon Cutoff">Epsilon Cutoff</span>
1314 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Epsilon cutoff sets a probability floor below which tokens are excluded from being sampled" title="Epsilon cutoff sets a probability floor below which tokens are excluded from being sampled.&#13;In units of 1e-4; a reasonable value is 3.&#13;Set to 0 to disable."></div>1314 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Epsilon cutoff sets a probability floor below which tokens are excluded from being sampled" title="Epsilon cutoff sets a probability floor below which tokens are excluded from being sampled.&#13;In units of 1e-4; a reasonable value is 3.&#13;Set to 0 to disable."></div>
@@ -1316,7 +1316,7 @@
1316 <input class="neo-range-slider" type="range" id="epsilon_cutoff_textgenerationwebui" name="volume" min="0" max="9" step="0.01">1316 <input class="neo-range-slider" type="range" id="epsilon_cutoff_textgenerationwebui" name="volume" min="0" max="9" step="0.01">
1317 <input class="neo-range-input" type="number" min="0" max="9" step="0.01" data-for="epsilon_cutoff_textgenerationwebui" id="epsilon_cutoff_counter_textgenerationwebui">1317 <input class="neo-range-input" type="number" min="0" max="9" step="0.01" data-for="epsilon_cutoff_textgenerationwebui" id="epsilon_cutoff_counter_textgenerationwebui">
1318 </div>1318 </div>
1319 <div data-tg-type="ooba,aphrodite,koboldcpp,llamacpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1319 <div data-tg-type="ooba,aphrodite,koboldcpp,llamacpp" data-tg-samplers="nsigma" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1320 <small>1320 <small>
1321 <span data-i18n="Top nsigma">Top nsigma</span>1321 <span data-i18n="Top nsigma">Top nsigma</span>
1322 <div class="fa-solid fa-circle-info opacity50p" title="A sampling method that filters logits based on their statistical properties. It keeps tokens within n standard deviations of the maximum logit value, providing a simpler alternative to top-p/top-k sampling while maintaining sampling stability across different temperatures."></div>1322 <div class="fa-solid fa-circle-info opacity50p" title="A sampling method that filters logits based on their statistical properties. It keeps tokens within n standard deviations of the maximum logit value, providing a simpler alternative to top-p/top-k sampling while maintaining sampling stability across different temperatures."></div>
@@ -1324,7 +1324,7 @@
1324 <input class="neo-range-slider" type="range" id="nsigma_textgenerationwebui" name="volume" min="0" max="5" step="0.01">1324 <input class="neo-range-slider" type="range" id="nsigma_textgenerationwebui" name="volume" min="0" max="5" step="0.01">
1325 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="nsigma_textgenerationwebui" id="nsigma_counter_textgenerationwebui">1325 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="nsigma_textgenerationwebui" id="nsigma_counter_textgenerationwebui">
1326 </div>1326 </div>
1327 <div data-tg-type="llamacpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1327 <div data-tg-type="llamacpp" data-tg-samplers="min_keep" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1328 <small>1328 <small>
1329 <span data-i18n="Min Keep">Min Keep</span>1329 <span data-i18n="Min Keep">Min Keep</span>
1330 <div class="fa-solid fa-circle-info opacity50p" title="A sampling modifier that ensures that truncation samplers such as top-p, min-p, typical-p, and xtc return at least this many tokens. Set to 0 to disable."></div>1330 <div class="fa-solid fa-circle-info opacity50p" title="A sampling modifier that ensures that truncation samplers such as top-p, min-p, typical-p, and xtc return at least this many tokens. Set to 0 to disable."></div>
@@ -1332,7 +1332,7 @@
1332 <input class="neo-range-slider" type="range" id="min_keep_textgenerationwebui" name="volume" min="0" max="50" step="1">1332 <input class="neo-range-slider" type="range" id="min_keep_textgenerationwebui" name="volume" min="0" max="50" step="1">
1333 <input class="neo-range-input" type="number" min="0" max="50" step="1" data-for="min_keep_textgenerationwebui" id="min_keep_counter_textgenerationwebui">1333 <input class="neo-range-input" type="number" min="0" max="50" step="1" data-for="min_keep_textgenerationwebui" id="min_keep_counter_textgenerationwebui">
1334 </div>1334 </div>
1335 <div data-tg-type="ooba,mancer,aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1335 <div data-tg-type="ooba,mancer,aphrodite" data-tg-samplers="eta_cutoff" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1336 <small>1336 <small>
1337 <span data-i18n="Eta Cutoff">Eta Cutoff</span>1337 <span data-i18n="Eta Cutoff">Eta Cutoff</span>
1338 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Eta_Cutoff_desc" title="Eta cutoff is the main parameter of the special Eta Sampling technique.&#13;In units of 1e-4; a reasonable value is 3.&#13;Set to 0 to disable.&#13;See the paper Truncation Sampling as Language Model Desmoothing by Hewitt et al. (2022) for details."></div>1338 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Eta_Cutoff_desc" title="Eta cutoff is the main parameter of the special Eta Sampling technique.&#13;In units of 1e-4; a reasonable value is 3.&#13;Set to 0 to disable.&#13;See the paper Truncation Sampling as Language Model Desmoothing by Hewitt et al. (2022) for details."></div>
@@ -1340,62 +1340,62 @@
1340 <input class="neo-range-slider" type="range" id="eta_cutoff_textgenerationwebui" name="volume" min="0" max="20" step="0.01">1340 <input class="neo-range-slider" type="range" id="eta_cutoff_textgenerationwebui" name="volume" min="0" max="20" step="0.01">
1341 <input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="eta_cutoff_textgenerationwebui" id="eta_cutoff_counter_textgenerationwebui">1341 <input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="eta_cutoff_textgenerationwebui" id="eta_cutoff_counter_textgenerationwebui">
1342 </div>1342 </div>
1343 <div data-tg-type-mode="except" data-tg-type="generic" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1343 <div data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="rep_pen" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1344 <small data-i18n="rep.pen">Repetition Penalty</small>1344 <small data-i18n="rep.pen">Repetition Penalty</small>
1345 <input class="neo-range-slider" type="range" id="rep_pen_textgenerationwebui" name="volume" min="1" max="3" step="0.01">1345 <input class="neo-range-slider" type="range" id="rep_pen_textgenerationwebui" name="volume" min="1" max="3" step="0.01">
1346 <input class="neo-range-input" type="number" min="1" max="3" step="0.01" data-for="rep_pen_textgenerationwebui" id="rep_pen_counter_textgenerationwebui">1346 <input class="neo-range-input" type="number" min="1" max="3" step="0.01" data-for="rep_pen_textgenerationwebui" id="rep_pen_counter_textgenerationwebui">
1347 </div>1347 </div>
1348 <div data-tg-type="ooba, koboldcpp, tabby, ollama, llamacpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1348 <div data-tg-type="ooba, koboldcpp, tabby, ollama, llamacpp" data-tg-samplers="rep_pen_range" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1349 <small data-i18n="rep.pen range">Rep Pen Range</small>1349 <small data-i18n="rep.pen range">Rep Pen Range</small>
1350 <input class="neo-range-slider" type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="-1" max="8192" step="1">1350 <input class="neo-range-slider" type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="-1" max="8192" step="1">
1351 <input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">1351 <input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
1352 </div>1352 </div>
1353 <div data-tg-type="koboldcpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1353 <div data-tg-type="koboldcpp" data-tg-samplers="rep_pen_slope" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1354 <small data-i18n="Rep. Pen. Slope">Rep Pen Slope</small>1354 <small data-i18n="Rep. Pen. Slope">Rep Pen Slope</small>
1355 <input class="neo-range-slider" type="range" id="rep_pen_slope_textgenerationwebui" name="volume" min="0" max="10" step="0.01">1355 <input class="neo-range-slider" type="range" id="rep_pen_slope_textgenerationwebui" name="volume" min="0" max="10" step="0.01">
1356 <input class="neo-range-input" type="number" min="0" max="10" step="0.01" data-for="rep_pen_slope_textgenerationwebui" id="rep_pen_slope_counter_textgenerationwebui">1356 <input class="neo-range-input" type="number" min="0" max="10" step="0.01" data-for="rep_pen_slope_textgenerationwebui" id="rep_pen_slope_counter_textgenerationwebui">
1357 </div>1357 </div>
1358 <div data-tg-type="tabby" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1358 <div data-tg-type="tabby" data-tg-samplers="rep_pen_decay" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1359 <small data-i18n="rep.pen decay">Rep Pen Decay</small>1359 <small data-i18n="rep.pen decay">Rep Pen Decay</small>
1360 <input class="neo-range-slider" type="range" id="rep_pen_decay_textgenerationwebui" name="volume" min="-1" max="8192" step="1">1360 <input class="neo-range-slider" type="range" id="rep_pen_decay_textgenerationwebui" name="volume" min="-1" max="8192" step="1">
1361 <input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_decay_textgenerationwebui" id="rep_pen_decay_counter_textgenerationwebui">1361 <input class="neo-range-input" type="number" min="-1" max="8192" step="1" data-for="rep_pen_decay_textgenerationwebui" id="rep_pen_decay_counter_textgenerationwebui">
1362 </div>1362 </div>
1363 <div data-tg-type="ooba" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1363 <div data-tg-type="ooba" data-tg-samplers="encoder_rep_pen" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1364 <small data-i18n="Encoder Rep. Pen.">Encoder Penalty</small>1364 <small data-i18n="Encoder Rep. Pen.">Encoder Penalty</small>
1365 <input class="neo-range-slider" type="range" id="encoder_rep_pen_textgenerationwebui" name="volume" min="0.8" max="1.5" step="0.01" />1365 <input class="neo-range-slider" type="range" id="encoder_rep_pen_textgenerationwebui" name="volume" min="0.8" max="1.5" step="0.01" />
1366 <input class="neo-range-input" type="number" min="0.8" max="1.5" step="0.01" data-for="encoder_rep_pen_textgenerationwebui" id="encoder_rep_pen_counter_textgenerationwebui">1366 <input class="neo-range-input" type="number" min="0.8" max="1.5" step="0.01" data-for="encoder_rep_pen_textgenerationwebui" id="encoder_rep_pen_counter_textgenerationwebui">
1367 </div>1367 </div>
1368 <div class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1368 <div data-tg-samplers="freq_pen" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1369 <small data-i18n="Frequency Penalty">Frequency Penalty</small>1369 <small data-i18n="Frequency Penalty">Frequency Penalty</small>
1370 <input class="neo-range-slider" type="range" id="freq_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />1370 <input class="neo-range-slider" type="range" id="freq_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
1371 <input class="neo-range-input" type="number" data-for="freq_pen_textgenerationwebui" min="-2" max="2" step="0.01" id="freq_pen_counter_textgenerationwebui">1371 <input class="neo-range-input" type="number" data-for="freq_pen_textgenerationwebui" min="-2" max="2" step="0.01" id="freq_pen_counter_textgenerationwebui">
1372 </div>1372 </div>
1373 <div class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1373 <div data-tg-samplers="presence_pen" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1374 <small data-i18n="Presence Penalty">Presence Penalty</small>1374 <small data-i18n="Presence Penalty">Presence Penalty</small>
1375 <input class="neo-range-slider" type="range" id="presence_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />1375 <input class="neo-range-slider" type="range" id="presence_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
1376 <input class="neo-range-input" type="number" min="-2" max="2" step="0.01" data-for="presence_pen_textgenerationwebui" id="presence_pen_counter_textgenerationwebui">1376 <input class="neo-range-input" type="number" min="-2" max="2" step="0.01" data-for="presence_pen_textgenerationwebui" id="presence_pen_counter_textgenerationwebui">
1377 </div>1377 </div>
1378 <div data-tg-type="aphrodite, ooba" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1378 <div data-tg-type="aphrodite, ooba" data-tg-samplers="no_repeat_ngram_size" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1379 <small data-i18n="No Repeat Ngram Size">No Repeat Ngram Size</small>1379 <small data-i18n="No Repeat Ngram Size">No Repeat Ngram Size</small>
1380 <input class="neo-range-slider" type="range" id="no_repeat_ngram_size_textgenerationwebui" name="volume" min="0" max="20" step="1">1380 <input class="neo-range-slider" type="range" id="no_repeat_ngram_size_textgenerationwebui" name="volume" min="0" max="20" step="1">
1381 <input class="neo-range-input" type="number" min="0" max="20" step="1" data-for="no_repeat_ngram_size_textgenerationwebui" id="no_repeat_ngram_size_counter_textgenerationwebui">1381 <input class="neo-range-input" type="number" min="0" max="20" step="1" data-for="no_repeat_ngram_size_textgenerationwebui" id="no_repeat_ngram_size_counter_textgenerationwebui">
1382 </div>1382 </div>
1383 <div data-tg-type="tabby, aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1383 <div data-tg-type="tabby, aphrodite" data-tg-samplers="skew" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1384 <small data-i18n="Skew">Skew</small>1384 <small data-i18n="Skew">Skew</small>
1385 <input class="neo-range-slider" type="range" id="skew_textgenerationwebui" name="volume" min="-5" max="5" step="0.01" />1385 <input class="neo-range-slider" type="range" id="skew_textgenerationwebui" name="volume" min="-5" max="5" step="0.01" />
1386 <input class="neo-range-input" type="number" min="-5" max="5" step="0.01" data-for="skew_textgenerationwebui" id="skew_counter_textgenerationwebui">1386 <input class="neo-range-input" type="number" min="-5" max="5" step="0.01" data-for="skew_textgenerationwebui" id="skew_counter_textgenerationwebui">
1387 </div>1387 </div>
1388 <div data-tg-type="mancer, ooba, tabby, dreamgen, infermaticai, aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1388 <div data-tg-type="mancer, ooba, tabby, dreamgen, infermaticai, aphrodite" data-tg-samplers="min_length" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1389 <small data-i18n="Min Length">Min Length</small>1389 <small data-i18n="Min Length">Min Length</small>
1390 <input class="neo-range-slider" type="range" id="min_length_textgenerationwebui" name="volume" min="0" max="2000" step="1" />1390 <input class="neo-range-slider" type="range" id="min_length_textgenerationwebui" name="volume" min="0" max="2000" step="1" />
1391 <input class="neo-range-input" type="number" min="0" max="2000" step="1" data-for="min_length_textgenerationwebui" id="min_length_counter_textgenerationwebui">1391 <input class="neo-range-input" type="number" min="0" max="2000" step="1" data-for="min_length_textgenerationwebui" id="min_length_counter_textgenerationwebui">
1392 </div>1392 </div>
1393 <div data-tg-type="ooba" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">1393 <div data-tg-type="ooba" data-tg-samplers="max_tokens_second" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
1394 <small data-i18n="Max Tokens Second">Maximum tokens/second</small>1394 <small data-i18n="Max Tokens Second">Maximum tokens/second</small>
1395 <input class="neo-range-slider" type="range" id="max_tokens_second_textgenerationwebui" name="volume" min="0" max="20" step="1" />1395 <input class="neo-range-slider" type="range" id="max_tokens_second_textgenerationwebui" name="volume" min="0" max="20" step="1" />
1396 <input class="neo-range-input" type="number" min="0" max="20" step="1" data-for="max_tokens_second_textgenerationwebui" id="max_tokens_second_counter_textgenerationwebui">1396 <input class="neo-range-input" type="number" min="0" max="20" step="1" data-for="max_tokens_second_textgenerationwebui" id="max_tokens_second_counter_textgenerationwebui">
1397 </div>1397 </div>
1398 <div data-tg-type="mancer, ooba, koboldcpp, aphrodite, tabby" id="smoothingBlock" name="smoothingBlock" class="wide100p">1398 <div data-tg-type="mancer, ooba, koboldcpp, aphrodite, tabby" data-tg-samplers="smoothing_factor" id="smoothingBlock" name="smoothingBlock" class="wide100p">
1399 <h4 class="wide100p textAlignCenter">1399 <h4 class="wide100p textAlignCenter">
1400 <label data-i18n="Smooth Sampling">Smooth Sampling</label>1400 <label data-i18n="Smooth Sampling">Smooth Sampling</label>
1401 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="[title]Smooth_Sampling_desc" title="Allows you to use quadratic/cubic transformations to adjust the distribution. Lower Smoothing Factor values will be more creative, usually between 0.2-0.3 is the sweetspot (assuming the curve = 1). Higher Smoothing Curve values will make the curve steeper, which will punish low probability choices more aggressively. 1.0 curve is equivalent to only using Smoothing Factor."></div>1401 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="[title]Smooth_Sampling_desc" title="Allows you to use quadratic/cubic transformations to adjust the distribution. Lower Smoothing Factor values will be more creative, usually between 0.2-0.3 is the sweetspot (assuming the curve = 1). Higher Smoothing Curve values will make the curve steeper, which will punish low probability choices more aggressively. 1.0 curve is equivalent to only using Smoothing Factor."></div>
@@ -1406,7 +1406,7 @@
1406 <input class="neo-range-slider" type="range" id="smoothing_factor_textgenerationwebui" name="volume" min="0" max="10" step="0.01" />1406 <input class="neo-range-slider" type="range" id="smoothing_factor_textgenerationwebui" name="volume" min="0" max="10" step="0.01" />
1407 <input class="neo-range-input" type="number" min="0" max="10" step="0.01" data-for="smoothing_factor_textgenerationwebui" id="smoothing_factor_counter_textgenerationwebui">1407 <input class="neo-range-input" type="number" min="0" max="10" step="0.01" data-for="smoothing_factor_textgenerationwebui" id="smoothing_factor_counter_textgenerationwebui">
1408 </div>1408 </div>
1409 <div data-tg-type="mancer, ooba, koboldcpp, aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">1409 <div data-tg-type="mancer, ooba, koboldcpp, aphrodite" data-tg-samplers="smoothing_curve" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
1410 <small data-i18n="Smoothing Curve">Smoothing Curve</small>1410 <small data-i18n="Smoothing Curve">Smoothing Curve</small>
1411 <input class="neo-range-slider" type="range" id="smoothing_curve_textgenerationwebui" name="volume" min="1" max="10" step="0.01" />1411 <input class="neo-range-slider" type="range" id="smoothing_curve_textgenerationwebui" name="volume" min="1" max="10" step="0.01" />
1412 <input class="neo-range-input" type="number" min="1" max="10" step="0.01" data-for="smoothing_curve_textgenerationwebui" id="smoothing_curve_counter_textgenerationwebui">1412 <input class="neo-range-input" type="number" min="1" max="10" step="0.01" data-for="smoothing_curve_textgenerationwebui" id="smoothing_curve_counter_textgenerationwebui">
@@ -1414,7 +1414,7 @@
1414 </div>1414 </div>
1415 </div>1415 </div>
14161416
1417 <div data-tg-type="koboldcpp, aphrodite, mancer, tabby, ooba, llamacpp" id="xtc_block" class="wide100p">1417 <div data-tg-type="koboldcpp, aphrodite, mancer, tabby, ooba, llamacpp" data-tg-samplers="xtc_probability" id="xtc_block" class="wide100p">
1418 <h4 class="wide100p textAlignCenter">1418 <h4 class="wide100p textAlignCenter">
1419 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>1419 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
1420 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">1420 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@@ -1422,7 +1422,7 @@
1422 </a>1422 </a>
1423 </h4>1423 </h4>
1424 <div class="flex-container flexFlowRow gap10px flexShrink">1424 <div class="flex-container flexFlowRow gap10px flexShrink">
1425 <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">1425 <div data-tg-samplers="xtc_threshold" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
1426 <small data-i18n="Threshold">Threshold</small>1426 <small data-i18n="Threshold">Threshold</small>
1427 <input class="neo-range-slider" type="range" id="xtc_threshold_textgenerationwebui" name="volume" min="0" max="0.5" step="0.01" />1427 <input class="neo-range-slider" type="range" id="xtc_threshold_textgenerationwebui" name="volume" min="0" max="0.5" step="0.01" />
1428 <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">1428 <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">
@@ -1435,7 +1435,7 @@
1435 </div>1435 </div>
1436 </div>1436 </div>
14371437
1438 <div data-tg-type="aphrodite, mancer, ooba, koboldcpp, tabby, llamacpp, dreamgen" id="dryBlock" class="wide100p">1438 <div data-tg-type="aphrodite, mancer, ooba, koboldcpp, tabby, llamacpp, dreamgen" data-tg-samplers="dry_multiplier" id="dryBlock" class="wide100p">
1439 <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">1439 <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">
1440 <label data-i18n="DRY Repetition Penalty">DRY Repetition Penalty</label>1440 <label data-i18n="DRY Repetition Penalty">DRY Repetition Penalty</label>
1441 <a href="https://github.com/oobabooga/text-generation-webui/pull/5677" target="_blank">1441 <a href="https://github.com/oobabooga/text-generation-webui/pull/5677" target="_blank">
@@ -1448,30 +1448,30 @@
1448 <input class="neo-range-slider" type="range" id="dry_multiplier_textgenerationwebui" min="0" max="5" step="0.01" />1448 <input class="neo-range-slider" type="range" id="dry_multiplier_textgenerationwebui" min="0" max="5" step="0.01" />
1449 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="dry_multiplier_textgenerationwebui" id="dry_multiplier_counter_textgenerationwebui">1449 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="dry_multiplier_textgenerationwebui" id="dry_multiplier_counter_textgenerationwebui">
1450 </div>1450 </div>
1451 <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" title="Controls how fast the penalty grows with increasing sequence length." data-i18n="[title]DRY_Base_desc">1451 <div data-tg-samplers="dry_base" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" title="Controls how fast the penalty grows with increasing sequence length." data-i18n="[title]DRY_Base_desc">
1452 <small data-i18n="Base">Base</small>1452 <small data-i18n="Base">Base</small>
1453 <input class="neo-range-slider" type="range" id="dry_base_textgenerationwebui" min="1" max="4" step="0.01" />1453 <input class="neo-range-slider" type="range" id="dry_base_textgenerationwebui" min="1" max="4" step="0.01" />
1454 <input class="neo-range-input" type="number" min="1" max="4" step="0.01" data-for="dry_base_textgenerationwebui" id="dry_base_counter_textgenerationwebui">1454 <input class="neo-range-input" type="number" min="1" max="4" step="0.01" data-for="dry_base_textgenerationwebui" id="dry_base_counter_textgenerationwebui">
1455 </div>1455 </div>
1456 <div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" title="Longest sequence that can be repeated without being penalized." data-i18n="[title]DRY_Allowed_Length_desc">1456 <div data-tg-samplers="dry_allowed_length" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" title="Longest sequence that can be repeated without being penalized." data-i18n="[title]DRY_Allowed_Length_desc">
1457 <small data-i18n="Allowed Length">Allowed Length</small>1457 <small data-i18n="Allowed Length">Allowed Length</small>
1458 <input class="neo-range-slider" type="range" id="dry_allowed_length_textgenerationwebui" min="1" max="20" step="1" />1458 <input class="neo-range-slider" type="range" id="dry_allowed_length_textgenerationwebui" min="1" max="20" step="1" />
1459 <input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="dry_allowed_length_textgenerationwebui" id="dry_allowed_length_counter_textgenerationwebui">1459 <input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="dry_allowed_length_textgenerationwebui" id="dry_allowed_length_counter_textgenerationwebui">
1460 </div>1460 </div>
1461 <div class="alignItemsCenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-tg-type="llamacpp, koboldcpp, tabby, aphrodite">1461 <div data-tg-samplers="dry_penalty_last_n" class="alignItemsCenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-tg-type="llamacpp, koboldcpp, tabby, aphrodite">
1462 <small data-i18n="Penalty Range">Penalty Range</small>1462 <small data-i18n="Penalty Range">Penalty Range</small>
1463 <input class="neo-range-slider" type="range" id="dry_penalty_last_n_textgenerationwebui" min="0" max="8192" step="1" />1463 <input class="neo-range-slider" type="range" id="dry_penalty_last_n_textgenerationwebui" min="0" max="8192" step="1" />
1464 <input class="neo-range-input" type="number" min="0" max="8192" step="1" data-for="dry_penalty_last_n_textgenerationwebui" id="dry_penalty_last_n_counter_textgenerationwebui">1464 <input class="neo-range-input" type="number" min="0" max="8192" step="1" data-for="dry_penalty_last_n_textgenerationwebui" id="dry_penalty_last_n_counter_textgenerationwebui">
1465 </div>1465 </div>
1466 </div>1466 </div>
1467 <div class="range-block marginTop5" title="Tokens across which sequence matching is not continued. Specified as a comma-separated list of quoted strings." data-i18n="[title]DRY_Sequence_Breakers_desc">1467 <div data-tg-samplers="dry_sequence_breakers" class="range-block marginTop5" title="Tokens across which sequence matching is not continued. Specified as a comma-separated list of quoted strings." data-i18n="[title]DRY_Sequence_Breakers_desc">
1468 <div class="range-block-title textAlignCenter flex-container justifyCenter alignitemscenter">1468 <div class="range-block-title textAlignCenter flex-container justifyCenter alignitemscenter">
1469 <small data-i18n="Sequence Breakers">Sequence Breakers</small>1469 <small data-i18n="Sequence Breakers">Sequence Breakers</small>
1470 </div>1470 </div>
1471 <textarea id="dry_sequence_breakers_textgenerationwebui" class="text_pole textarea_compact" name="sequence_breakers" rows="3" data-i18n="[placeholder]JSON-serialized array of strings." placeholder="JSON-serialized array of strings."></textarea>1471 <textarea id="dry_sequence_breakers_textgenerationwebui" class="text_pole textarea_compact" name="sequence_breakers" rows="3" data-i18n="[placeholder]JSON-serialized array of strings." placeholder="JSON-serialized array of strings."></textarea>
1472 </div>1472 </div>
1473 </div>1473 </div>
1474 <div data-tg-type="ooba, mancer, koboldcpp, tabby, llamacpp, aphrodite" id="dynatemp_block_ooba" class="wide100p">1474 <div data-tg-type="ooba, mancer, koboldcpp, tabby, llamacpp, aphrodite" data-tg-samplers="dynatemp" id="dynatemp_block_ooba" class="wide100p">
1475 <h4 class="wide100p textAlignCenter">1475 <h4 class="wide100p textAlignCenter">
1476 <div class="flex-container alignitemscenter justifyCenter">1476 <div class="flex-container alignitemscenter justifyCenter">
1477 <div class="checkbox_label" for="dynatemp_textgenerationwebui">1477 <div class="checkbox_label" for="dynatemp_textgenerationwebui">
@@ -1482,24 +1482,24 @@
1482 </div>1482 </div>
1483 </h4>1483 </h4>
1484 <div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">1484 <div class="flex-container flexFlowRow alignitemscenter gap10px flexShrink">
1485 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1485 <div data-tg-samplers="min_temp" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1486 <small data-i18n="Minimum Temp">Minimum Temp</small>1486 <small data-i18n="Minimum Temp">Minimum Temp</small>
1487 <input class="neo-range-slider" type="range" id="min_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.01" />1487 <input class="neo-range-slider" type="range" id="min_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.01" />
1488 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="min_temp_textgenerationwebui" id="min_temp_counter_textgenerationwebui">1488 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="min_temp_textgenerationwebui" id="min_temp_counter_textgenerationwebui">
1489 </div>1489 </div>
1490 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1490 <div data-tg-samplers="max_temp" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1491 <small data-i18n="Maximum Temp">Maximum Temp</small>1491 <small data-i18n="Maximum Temp">Maximum Temp</small>
1492 <input class="neo-range-slider" type="range" id="max_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.01" />1492 <input class="neo-range-slider" type="range" id="max_temp_textgenerationwebui" name="volume" min="0" max="5" step="0.01" />
1493 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="max_temp_textgenerationwebui" id="max_temp_counter_textgenerationwebui">1493 <input class="neo-range-input" type="number" min="0" max="5" step="0.01" data-for="max_temp_textgenerationwebui" id="max_temp_counter_textgenerationwebui">
1494 </div>1494 </div>
1495 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1495 <div data-tg-samplers="dynatemp_exponent" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1496 <small data-i18n="Exponent">Exponent</small>1496 <small data-i18n="Exponent">Exponent</small>
1497 <input class="neo-range-slider" type="range" id="dynatemp_exponent_textgenerationwebui" name="volume" min="0.001" max="10" step="0.001" />1497 <input class="neo-range-slider" type="range" id="dynatemp_exponent_textgenerationwebui" name="volume" min="0.001" max="10" step="0.001" />
1498 <input class="neo-range-input" type="number" min="0.001" max="10" step="0.001" data-for="dynatemp_exponent_textgenerationwebui" id="dynatemp_exponent_counter_textgenerationwebui">1498 <input class="neo-range-input" type="number" min="0.001" max="10" step="0.001" data-for="dynatemp_exponent_textgenerationwebui" id="dynatemp_exponent_counter_textgenerationwebui">
1499 </div>1499 </div>
1500 </div>1500 </div>
1501 </div>1501 </div>
1502 <div data-tg-type="ooba,infermaticai,koboldcpp,llamacpp,tabby" id="mirostat_block_ooba" class="wide100p">1502 <div data-tg-type="ooba,infermaticai,koboldcpp,llamacpp,tabby" data-tg-samplers="mirostat_mode" id="mirostat_block_ooba" class="wide100p">
1503 <h4 class="wide100p textAlignCenter">1503 <h4 class="wide100p textAlignCenter">
1504 <label data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat</label>1504 <label data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat</label>
1505 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="[title]Mirostat_desc" title="Mirostat is a thermostat for output perplexity.&#13;Mirostat matches the output perplexity to that of the input, thus avoiding the repetition trap&#13;(where, as the autoregressive inference produces text, the perplexity of the output tends toward zero)&#13;and the confusion trap (where the perplexity diverges).&#13;For details, see the paper Mirostat: A Neural Text Decoding Algorithm that Directly Controls Perplexity by Basu et al. (2020).&#13;Mode chooses the Mirostat version. 0=disable, 1=Mirostat 1.0 (llama.cpp only), 2=Mirostat 2.0.&#13;Tau = Variability parameter for Mirostat outputs.&#13;Eta = Learning rate of Mirostat."></div>1505 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="[title]Mirostat_desc" title="Mirostat is a thermostat for output perplexity.&#13;Mirostat matches the output perplexity to that of the input, thus avoiding the repetition trap&#13;(where, as the autoregressive inference produces text, the perplexity of the output tends toward zero)&#13;and the confusion trap (where the perplexity diverges).&#13;For details, see the paper Mirostat: A Neural Text Decoding Algorithm that Directly Controls Perplexity by Basu et al. (2020).&#13;Mode chooses the Mirostat version. 0=disable, 1=Mirostat 1.0 (llama.cpp only), 2=Mirostat 2.0.&#13;Tau = Variability parameter for Mirostat outputs.&#13;Eta = Learning rate of Mirostat."></div>
@@ -1510,19 +1510,19 @@
1510 <input class="neo-range-slider" type="range" id="mirostat_mode_textgenerationwebui" name="volume" min="0" max="2" step="1" />1510 <input class="neo-range-slider" type="range" id="mirostat_mode_textgenerationwebui" name="volume" min="0" max="2" step="1" />
1511 <input class="neo-range-input" type="number" min="0" max="2" step="1" data-for="mirostat_mode_textgenerationwebui" id="mirostat_mode_counter_textgenerationwebui">1511 <input class="neo-range-input" type="number" min="0" max="2" step="1" data-for="mirostat_mode_textgenerationwebui" id="mirostat_mode_counter_textgenerationwebui">
1512 </div>1512 </div>
1513 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1513 <div data-tg-samplers="mirostat_tau" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1514 <small data-i18n="Mirostat Tau">Tau</small>1514 <small data-i18n="Mirostat Tau">Tau</small>
1515 <input class="neo-range-slider" type="range" id="mirostat_tau_textgenerationwebui" name="volume" min="0" max="20" step="0.01" />1515 <input class="neo-range-slider" type="range" id="mirostat_tau_textgenerationwebui" name="volume" min="0" max="20" step="0.01" />
1516 <input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="mirostat_tau_textgenerationwebui" id="mirostat_tau_counter_textgenerationwebui">1516 <input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="mirostat_tau_textgenerationwebui" id="mirostat_tau_counter_textgenerationwebui">
1517 </div>1517 </div>
1518 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1518 <div data-tg-samplers="mirostat_eta" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1519 <small data-i18n="Mirostat Eta">Eta</small>1519 <small data-i18n="Mirostat Eta">Eta</small>
1520 <input class="neo-range-slider" type="range" id="mirostat_eta_textgenerationwebui" name="volume" min="0" max="1" step="0.01" />1520 <input class="neo-range-slider" type="range" id="mirostat_eta_textgenerationwebui" name="volume" min="0" max="1" step="0.01" />
1521 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="mirostat_eta_textgenerationwebui" id="mirostat_eta_counter_textgenerationwebui">1521 <input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="mirostat_eta_textgenerationwebui" id="mirostat_eta_counter_textgenerationwebui">
1522 </div>1522 </div>
1523 </div>1523 </div>
1524 </div>1524 </div>
1525 <div data-tg-type="ooba" id="beamSearchBlock" name="beamSearchBlock" class="wide100p">1525 <div data-tg-type="ooba" data-tg-samplers="num_beams" id="beamSearchBlock" name="beamSearchBlock" class="wide100p">
1526 <h4 class="wide100p textAlignCenter">1526 <h4 class="wide100p textAlignCenter">
1527 <label>1527 <label>
1528 <span data-i18n="Beam search">Beam Search</span>1528 <span data-i18n="Beam search">Beam Search</span>
@@ -1538,7 +1538,7 @@
1538 <input class="neo-range-slider" type="range" id="num_beams_textgenerationwebui" name="volume" min="1" max="20" step="1" />1538 <input class="neo-range-slider" type="range" id="num_beams_textgenerationwebui" name="volume" min="1" max="20" step="1" />
1539 <input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="num_beams_textgenerationwebui" id="num_beams_counter_textgenerationwebui">1539 <input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="num_beams_textgenerationwebui" id="num_beams_counter_textgenerationwebui">
1540 </div>1540 </div>
1541 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">1541 <div data-tg-samplers="length_penalty" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
1542 <label>1542 <label>
1543 <small data-i18n="Length Penalty">Length Penalty</small>1543 <small data-i18n="Length Penalty">Length Penalty</small>
1544 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Penalize sequences based on their length." title="Penalize sequences based on their length."></div>1544 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Penalize sequences based on their length." title="Penalize sequences based on their length."></div>
@@ -1546,7 +1546,7 @@
1546 <input class="neo-range-slider" type="range" id="length_penalty_textgenerationwebui" name="volume" min="-5" max="5" step="0.1" />1546 <input class="neo-range-slider" type="range" id="length_penalty_textgenerationwebui" name="volume" min="-5" max="5" step="0.1" />
1547 <input class="neo-range-input" type="number" min="-5" max="5" step="0.1" data-for="length_penalty_textgenerationwebui" id="length_penalty_counter_textgenerationwebui">1547 <input class="neo-range-input" type="number" min="-5" max="5" step="0.1" data-for="length_penalty_textgenerationwebui" id="length_penalty_counter_textgenerationwebui">
1548 </div>1548 </div>
1549 <div class="">1549 <div data-tg-samplers="early_stopping" class="">
1550 <label class="checkbox_label" for="early_stopping_textgenerationwebui">1550 <label class="checkbox_label" for="early_stopping_textgenerationwebui">
1551 <input type="checkbox" id="early_stopping_textgenerationwebui" />1551 <input type="checkbox" id="early_stopping_textgenerationwebui" />
1552 <small data-i18n="Early Stopping">Early Stopping</small>1552 <small data-i18n="Early Stopping">Early Stopping</small>
@@ -1555,7 +1555,7 @@
1555 </div>1555 </div>
1556 </div>1556 </div>
1557 </div>1557 </div>
1558 <div data-tg-type="ooba" id="contrastiveSearchBlock" name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">1558 <div data-tg-type="ooba" data-tg-samplers="penalty_alpha" id="contrastiveSearchBlock" name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
1559 <h4 class="textAlignCenter">1559 <h4 class="textAlignCenter">
1560 <span data-i18n="Contrastive search">Contrastive Search</span>1560 <span data-i18n="Contrastive search">Contrastive Search</span>
1561 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="Contrastive_search_txt" title="A sampler that encourages diversity while maintaining coherence, by exploiting the isotropicity of the representation space of most LLMs. For details, see the paper A Contrastive Framework for Neural Text Generation by Su et al. (2022)."></div>1561 <div class=" fa-solid fa-circle-info opacity50p " data-i18n="Contrastive_search_txt" title="A sampler that encourages diversity while maintaining coherence, by exploiting the isotropicity of the representation space of most LLMs. For details, see the paper A Contrastive Framework for Neural Text Generation by Su et al. (2022)."></div>
@@ -1571,64 +1571,64 @@
1571 </div>1571 </div>
1572 <div name="checkboxes" class="flex-container flexBasis48p justifyCenter flexGrow flexShrink ">1572 <div name="checkboxes" class="flex-container flexBasis48p justifyCenter flexGrow flexShrink ">
1573 <div class="flex-container flexFlowColumn marginTop5">1573 <div class="flex-container flexFlowColumn marginTop5">
1574 <label data-tg-type="ooba" class="checkbox_label flexGrow flexShrink" for="do_sample_textgenerationwebui">1574 <label data-tg-type="ooba" data-tg-samplers="do_sample" class="checkbox_label flexGrow flexShrink" for="do_sample_textgenerationwebui">
1575 <input type="checkbox" id="do_sample_textgenerationwebui" />1575 <input type="checkbox" id="do_sample_textgenerationwebui" />
1576 <small data-i18n="Do Sample">Do Sample</small>1576 <small data-i18n="Do Sample">Do Sample</small>
1577 </label>1577 </label>
1578 <label data-tg-type="ooba, tabby" class="checkbox_label flexGrow flexShrink" for="add_bos_token_textgenerationwebui">1578 <label data-tg-type="ooba, tabby" data-tg-samplers="add_bos_token" class="checkbox_label flexGrow flexShrink" for="add_bos_token_textgenerationwebui">
1579 <input type="checkbox" id="add_bos_token_textgenerationwebui" />1579 <input type="checkbox" id="add_bos_token_textgenerationwebui" />
1580 <small data-i18n="Add BOS Token">Add BOS Token</small>1580 <small data-i18n="Add BOS Token">Add BOS Token</small>
1581 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative" title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative."></div>1581 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative" title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative."></div>
1582 </label>1582 </label>
1583 <label data-tg-type="ooba, llamacpp, tabby, koboldcpp, dreamgen" class="checkbox_label flexGrow flexShrink" for="ban_eos_token_textgenerationwebui">1583 <label data-tg-type="ooba, llamacpp, tabby, koboldcpp, dreamgen" data-tg-samplers="ban_eos_token" class="checkbox_label flexGrow flexShrink" for="ban_eos_token_textgenerationwebui">
1584 <input type="checkbox" id="ban_eos_token_textgenerationwebui" />1584 <input type="checkbox" id="ban_eos_token_textgenerationwebui" />
1585 <small data-i18n="Ban EOS Token">Ban EOS Token</small>1585 <small data-i18n="Ban EOS Token">Ban EOS Token</small>
1586 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Ban the eos_token. This forces the model to never end the generation prematurely" title="Ban the eos_token. This forces the model to never end the generation prematurely."></div>1586 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Ban the eos_token. This forces the model to never end the generation prematurely" title="Ban the eos_token. This forces the model to never end the generation prematurely."></div>
1587 </label>1587 </label>
1588 <label data-tg-type="vllm, aphrodite, infermaticai" class="checkbox_label" for="ignore_eos_token_textgenerationwebui">1588 <label data-tg-type="vllm, aphrodite, infermaticai" data-tg-samplers="ignore_eos_token" class="checkbox_label" for="ignore_eos_token_textgenerationwebui">
1589 <input type="checkbox" id="ignore_eos_token_textgenerationwebui" />1589 <input type="checkbox" id="ignore_eos_token_textgenerationwebui" />
1590 <small data-i18n="Ignore EOS Token">Ignore EOS Token</small>1590 <small data-i18n="Ignore EOS Token">Ignore EOS Token</small>
1591 <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>1591 <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>
1592 </label>1592 </label>
1593 <label data-tg-type-mode="except" data-tg-type="generic" class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui">1593 <label data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="skip_special_tokens" class="checkbox_label flexGrow flexShrink" for="skip_special_tokens_textgenerationwebui">
1594 <input type="checkbox" id="skip_special_tokens_textgenerationwebui" />1594 <input type="checkbox" id="skip_special_tokens_textgenerationwebui" />
1595 <small data-i18n="Skip Special Tokens">Skip Special Tokens</small>1595 <small data-i18n="Skip Special Tokens">Skip Special Tokens</small>
1596 </label>1596 </label>
1597 <label data-tg-type="openrouter" class="checkbox_label flexGrow flexShrink" for="include_reasoning_textgenerationwebui">1597 <label data-tg-type="openrouter" data-tg-samplers="include_reasoning" class="checkbox_label flexGrow flexShrink" for="include_reasoning_textgenerationwebui">
1598 <input type="checkbox" id="include_reasoning_textgenerationwebui" />1598 <input type="checkbox" id="include_reasoning_textgenerationwebui" />
1599 <small data-i18n="Request Model Reasoning">Request Model Reasoning</small>1599 <small data-i18n="Request Model Reasoning">Request Model Reasoning</small>
1600 </label>1600 </label>
1601 <label data-tg-type="ooba, aphrodite, tabby" class="checkbox_label flexGrow flexShrink" for="temperature_last_textgenerationwebui">1601 <label data-tg-type="ooba, aphrodite, tabby" data-tg-samplers="temperature_last" class="checkbox_label flexGrow flexShrink" for="temperature_last_textgenerationwebui">
1602 <input type="checkbox" id="temperature_last_textgenerationwebui" />1602 <input type="checkbox" id="temperature_last_textgenerationwebui" />
1603 <small data-i18n="Temperature Last">Temperature Last</small>1603 <small data-i18n="Temperature Last">Temperature Last</small>
1604 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Temperature_Last_desc" title="Use the temperature sampler last. This is almost always the sensible thing to do.&#13;When enabled: sample the set of plausible tokens first, then apply temperature to adjust their relative probabilities (technically, logits).&#13;When disabled: apply temperature to adjust the relative probabilities of ALL tokens first, then sample plausible tokens from that.&#13;Disabling Temperature Last boosts the probabilities in the tail of the distribution, which tends to amplify the chances of getting an incoherent response."></div>1604 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Temperature_Last_desc" title="Use the temperature sampler last. This is almost always the sensible thing to do.&#13;When enabled: sample the set of plausible tokens first, then apply temperature to adjust their relative probabilities (technically, logits).&#13;When disabled: apply temperature to adjust the relative probabilities of ALL tokens first, then sample plausible tokens from that.&#13;Disabling Temperature Last boosts the probabilities in the tail of the distribution, which tends to amplify the chances of getting an incoherent response."></div>
1605 </label>1605 </label>
1606 <label data-tg-type="tabby" class="checkbox_label flexGrow flexShrink" for="speculative_ngram_textgenerationwebui">1606 <label data-tg-type="tabby" data-tg-samplers="speculative_ngram" class="checkbox_label flexGrow flexShrink" for="speculative_ngram_textgenerationwebui">
1607 <input type="checkbox" id="speculative_ngram_textgenerationwebui" />1607 <input type="checkbox" id="speculative_ngram_textgenerationwebui" />
1608 <small data-i18n="Speculative Ngram">Speculative Ngram</small>1608 <small data-i18n="Speculative Ngram">Speculative Ngram</small>
1609 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Use a different speculative decoding method without a draft model" title="Use a different speculative decoding method without a draft model.&#13;Using a draft model is preferred. Speculative ngram is not as effective."></div>1609 <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Use a different speculative decoding method without a draft model" title="Use a different speculative decoding method without a draft model.&#13;Using a draft model is preferred. Speculative ngram is not as effective."></div>
1610 </label>1610 </label>
1611 <label data-tg-type="vllm, aphrodite, infermaticai" class="checkbox_label" for="spaces_between_special_tokens_textgenerationwebui">1611 <label data-tg-type="vllm, aphrodite, infermaticai" data-tg-samplers="spaces_between_special_tokens" class="checkbox_label" for="spaces_between_special_tokens_textgenerationwebui">
1612 <input type="checkbox" id="spaces_between_special_tokens_textgenerationwebui" />1612 <input type="checkbox" id="spaces_between_special_tokens_textgenerationwebui" />
1613 <small data-i18n="Spaces Between Special Tokens">Spaces Between Special Tokens</small>1613 <small data-i18n="Spaces Between Special Tokens">Spaces Between Special Tokens</small>
1614 </label>1614 </label>
1615 </div>1615 </div>
1616 </div>1616 </div>
1617 <div data-tg-type="mancer, ooba, koboldcpp, vllm, aphrodite, llamacpp, ollama, infermaticai, huggingface, generic" class="flex-container flexFlowColumn alignitemscenter flexBasis48p flexGrow flexShrink gap0">1617 <div data-tg-type="mancer, ooba, koboldcpp, vllm, aphrodite, llamacpp, ollama, infermaticai, huggingface, generic" data-tg-samplers="seed" class="flex-container flexFlowColumn alignitemscenter flexBasis48p flexGrow flexShrink gap0">
1618 <label>1618 <label>
1619 <small data-i18n="Seed">Seed</small>1619 <small data-i18n="Seed">Seed</small>
1620 <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>1620 <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>
1621 </label>1621 </label>
1622 <input type="number" id="seed_textgenerationwebui" class="text_pole textAlignCenter" min="-1" value="-1" />1622 <input type="number" id="seed_textgenerationwebui" class="text_pole textAlignCenter" min="-1" value="-1" />
1623 </div>1623 </div>
1624 <div data-tg-type-mode="except" data-tg-type="generic" id="banned_tokens_block_ooba" class="wide100p">1624 <div data-tg-type-mode="except" data-tg-type="generic" data-tg-samplers="banned_tokens" id="banned_tokens_block_ooba" class="wide100p">
1625 <hr class="width100p">1625 <hr class="width100p">
1626 <div class="range-block-title title_restorable">1626 <div class="range-block-title title_restorable">
1627 <div>1627 <div>
1628 <strong data-i18n="Banned Tokens">Banned Tokens/Strings</strong>1628 <strong data-i18n="Banned Tokens">Banned Tokens/Strings</strong>
1629 <div class="margin5 fa-solid fa-circle-info opacity50p " data-i18n="[title]LLaMA / Mistral / Yi models only" title="Enter sequences you don't want to appear in the output.&#13;Unquoted text will be tokenized in the back end and banned as tokens.&#13;[token ids] will be banned as-is.&#13;Most tokens have a leading space. Use token counter (with the correct tokenizer selected first!) if you are unsure.&#13;Enclose text in double quotes to ban the entire string as a set.&#13;Quoted Strings and [Token ids] must be on their own line."></div>1629 <div class="margin5 fa-solid fa-circle-info opacity50p " data-i18n="[title]LLaMA / Mistral / Yi models only" title="Enter sequences you don't want to appear in the output.&#13;Unquoted text will be tokenized in the back end and banned as tokens.&#13;[token ids] will be banned as-is.&#13;Most tokens have a leading space. Use token counter (with the correct tokenizer selected first!) if you are unsure.&#13;Enclose text in double quotes to ban the entire string as a set.&#13;Quoted Strings and [Token ids] must be on their own line."></div>
1630 </div>1630 </div>
1631 <label id="send_banned_tokens_label" for="send_banned_tokens_textgenerationwebui" class="checkbox_label">1631 <label data-tg-samplers="send_banned_tokens" id="send_banned_tokens_label" for="send_banned_tokens_textgenerationwebui" class="checkbox_label">
1632 <input id="send_banned_tokens_textgenerationwebui" type="checkbox" style="display:none;" />1632 <input id="send_banned_tokens_textgenerationwebui" type="checkbox" style="display:none;" />
1633 <small><i class="fa-solid fa-power-off menu_button togglable margin0"></i></small>1633 <small><i class="fa-solid fa-power-off menu_button togglable margin0"></i></small>
1634 </label>1634 </label>
@@ -1637,7 +1637,7 @@
1637 <div class="textAlignCenter">1637 <div class="textAlignCenter">
1638 <small data-i18n="Global list">Global list</small>1638 <small data-i18n="Global list">Global list</small>
1639 </div>1639 </div>
1640 <div class="wide100p marginBot10">1640 <div data-tg-samplers="global_banned_tokens" class="wide100p marginBot10">
1641 <textarea id="global_banned_tokens_textgenerationwebui" class="text_pole textarea_compact" name="global_banned_tokens_textgenerationwebui" rows="3" data-i18n="[placeholder]Example: some text [42, 69, 1337]" placeholder='some text as tokens&#10;[420, 69, 1337]&#10;"Some verbatim string"'></textarea>1641 <textarea id="global_banned_tokens_textgenerationwebui" class="text_pole textarea_compact" name="global_banned_tokens_textgenerationwebui" rows="3" data-i18n="[placeholder]Example: some text [42, 69, 1337]" placeholder='some text as tokens&#10;[420, 69, 1337]&#10;"Some verbatim string"'></textarea>
1642 </div>1642 </div>
1643 <div class="textAlignCenter">1643 <div class="textAlignCenter">
@@ -1648,7 +1648,7 @@
1648 </div>1648 </div>
1649 </div>1649 </div>
1650 </div>1650 </div>
1651 <div class="range-block wide100p" id="logit_bias_block_ooba">1651 <div data-tg-samplers="logit_bias" class="range-block wide100p" id="logit_bias_block_ooba">
1652 <div id="logit_bias_textgenerationwebui" class="range-block-title title_restorable">1652 <div id="logit_bias_textgenerationwebui" class="range-block-title title_restorable">
1653 <h4>1653 <h4>
1654 <span data-i18n="Logit Bias">Logit Bias</span>1654 <span data-i18n="Logit Bias">Logit Bias</span>
@@ -1665,7 +1665,7 @@
1665 <div class="logit_bias_list"></div>1665 <div class="logit_bias_list"></div>
1666 </div>1666 </div>
1667 </div>1667 </div>
1668 <div id="cfg_block_ooba" data-tg-type="ooba, tabby" class="flex-container flexFlowColumn wide100p">1668 <div id="cfg_block_ooba" data-tg-type="ooba, tabby" data-tg-samplers="guidance_scale" class="flex-container flexFlowColumn wide100p">
1669 <hr class="width100p">1669 <hr class="width100p">
1670 <h4 class="textAlignCenter">1670 <h4 class="textAlignCenter">
1671 <span data-i18n="CFG">CFG</span>1671 <span data-i18n="CFG">CFG</span>
@@ -1676,7 +1676,7 @@
1676 <input class="neo-range-slider" type="range" id="guidance_scale_textgenerationwebui" name="volume" min="0.1" max="4" step="0.05">1676 <input class="neo-range-slider" type="range" id="guidance_scale_textgenerationwebui" name="volume" min="0.1" max="4" step="0.05">
1677 <input class="neo-range-input" type="number" min="0.1" max="4" step="0.05" data-for="guidance_scale_textgenerationwebui" id="guidance_scale_counter_textgenerationwebui">1677 <input class="neo-range-input" type="number" min="0.1" max="4" step="0.05" data-for="guidance_scale_textgenerationwebui" id="guidance_scale_counter_textgenerationwebui">
1678 </div>1678 </div>
1679 <div class="range-block">1679 <div data-tg-samplers="negative_prompt" class="range-block">
1680 <div class="alignitemscenter justifyCenter flex-container flexShrink">1680 <div class="alignitemscenter justifyCenter flex-container flexShrink">
1681 <small data-i18n="Negative Prompt">Negative Prompt</small>1681 <small data-i18n="Negative Prompt">Negative Prompt</small>
1682 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Used if CFG Scale is unset globally, per chat or character" title="Used if CFG Scale is unset globally, per chat or character"></div>1682 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Used if CFG Scale is unset globally, per chat or character" title="Used if CFG Scale is unset globally, per chat or character"></div>
@@ -1684,7 +1684,7 @@
1684 <textarea id="negative_prompt_textgenerationwebui" class="wide100p text_pole textarea_compact" name="negative_prompt" rows="3" data-i18n="[placeholder]Add text here that would make the AI generate things you don't want in your outputs." placeholder="Add text here that would make the AI generate things you don't want in your outputs."></textarea>1684 <textarea id="negative_prompt_textgenerationwebui" class="wide100p text_pole textarea_compact" name="negative_prompt" rows="3" data-i18n="[placeholder]Add text here that would make the AI generate things you don't want in your outputs." placeholder="Add text here that would make the AI generate things you don't want in your outputs."></textarea>
1685 </div>1685 </div>
1686 </div>1686 </div>
1687 <div id="grammar_block_ooba" data-tg-type="ooba,aphrodite,tabby" class="wide100p">1687 <div id="grammar_block_ooba" data-tg-type="ooba,aphrodite,tabby" data-tg-samplers="grammar_string" class="wide100p">
1688 <hr class="wide100p">1688 <hr class="wide100p">
1689 <h4 class="wide100p textAlignCenter">1689 <h4 class="wide100p textAlignCenter">
1690 <div class="flex-container justifyCenter alignitemscenter">1690 <div class="flex-container justifyCenter alignitemscenter">
@@ -1697,7 +1697,7 @@
1697 </h4>1697 </h4>
1698 <textarea id="grammar_string_textgenerationwebui" rows="4" class="text_pole textarea_compact monospace" data-i18n="[placeholder]Type in the desired custom grammar" placeholder="Type in the desired custom grammar"></textarea>1698 <textarea id="grammar_string_textgenerationwebui" rows="4" class="text_pole textarea_compact monospace" data-i18n="[placeholder]Type in the desired custom grammar" placeholder="Type in the desired custom grammar"></textarea>
1699 </div>1699 </div>
1700 <div id="json_schema_block" data-tg-type="tabby, llamacpp, aphrodite" class="wide100p">1700 <div id="json_schema_block" data-tg-type="tabby, llamacpp, aphrodite" data-tg-samplers="json_schema" class="wide100p">
1701 <hr class="wide100p">1701 <hr class="wide100p">
1702 <h4 class="wide100p textAlignCenter"><span data-i18n="JSON Schema">JSON Schema</span>1702 <h4 class="wide100p textAlignCenter"><span data-i18n="JSON Schema">JSON Schema</span>
1703 <a href="https://json-schema.org/learn/getting-started-step-by-step" target="_blank">1703 <a href="https://json-schema.org/learn/getting-started-step-by-step" target="_blank">
@@ -1708,7 +1708,7 @@
1708 </h4>1708 </h4>
1709 <textarea id="tabby_json_schema" rows="4" class="text_pole textarea_compact monospace" data-i18n="[placeholder]Type in the desired JSON schema" placeholder="Type in the desired JSON schema"></textarea>1709 <textarea id="tabby_json_schema" rows="4" class="text_pole textarea_compact monospace" data-i18n="[placeholder]Type in the desired JSON schema" placeholder="Type in the desired JSON schema"></textarea>
1710 </div>1710 </div>
1711 <div id="sampler_order_block_kcpp" data-tg-type="koboldcpp" class="range-block flexFlowColumn wide100p">1711 <div id="sampler_order_block_kcpp" data-tg-type="koboldcpp" data-tg-samplers="sampler_order" class="range-block flexFlowColumn wide100p">
1712 <hr class="wide100p">1712 <hr class="wide100p">
1713 <div class="range-block-title">1713 <div class="range-block-title">
1714 <span data-i18n="Samplers Order">Samplers Order</span>1714 <span data-i18n="Samplers Order">Samplers Order</span>
@@ -1751,7 +1751,7 @@
1751 <span data-i18n="Load default order">Load default order</span>1751 <span data-i18n="Load default order">Load default order</span>
1752 </div>1752 </div>
1753 </div>1753 </div>
1754 <div id="sampler_order_block_lcpp" data-tg-type="llamacpp" class="range-block flexFlowColumn wide100p">1754 <div id="sampler_order_block_lcpp" data-tg-type="llamacpp" data-tg-samplers="samplers" class="range-block flexFlowColumn wide100p">
1755 <hr class="wide100p">1755 <hr class="wide100p">
1756 <h4 class="range-block-title justifyCenter">1756 <h4 class="range-block-title justifyCenter">
1757 <span data-i18n="Sampler Order">Sampler Order</span>1757 <span data-i18n="Sampler Order">Sampler Order</span>
@@ -1775,7 +1775,7 @@
1775 <span data-i18n="Load default order">Load default order</span>1775 <span data-i18n="Load default order">Load default order</span>
1776 </div>1776 </div>
1777 </div>1777 </div>
1778 <div id="sampler_priority_block_ooba" data-tg-type="ooba" class="range-block flexFlowColumn wide100p">1778 <div id="sampler_priority_block_ooba" data-tg-type="ooba" data-tg-samplers="sampler_priority" class="range-block flexFlowColumn wide100p">
1779 <hr class="wide100p">1779 <hr class="wide100p">
1780 <h4 class="range-block-title justifyCenter">1780 <h4 class="range-block-title justifyCenter">
1781 <span data-i18n="Sampler Priority">Sampler Priority</span>1781 <span data-i18n="Sampler Priority">Sampler Priority</span>
@@ -1810,7 +1810,7 @@
1810 <span data-i18n="Load default order">Load default order</span>1810 <span data-i18n="Load default order">Load default order</span>
1811 </div>1811 </div>
1812 </div>1812 </div>
1813 <div id="sampler_priority_block_aphrodite" data-tg-type="aphrodite" class="range-block flexFlowColumn wide100p">1813 <div id="sampler_priority_block_aphrodite" data-tg-type="aphrodite" data-tg-samplers="samplers_priorities" class="range-block flexFlowColumn wide100p">
1814 <hr class="wide100p">1814 <hr class="wide100p">
1815 <h4 class="range-block-title justifyCenter">1815 <h4 class="range-block-title justifyCenter">
1816 <span data-i18n="Sampler Order">Sampler Order</span>1816 <span data-i18n="Sampler Order">Sampler Order</span>
public/scripts/extensions/connection-manager/index.js+1 -1
@@ -47,8 +47,8 @@ const CC_COMMANDS = [
47];47];
4848
49const TC_COMMANDS = [49const TC_COMMANDS = [
50 'api',
51 'preset',50 'preset',
51 'api',
52 'api-url',52 'api-url',
53 'model',53 'model',
54 'sysprompt',54 'sysprompt',
public/scripts/preset-manager.js+11 -0
@@ -27,6 +27,7 @@ import { oai_settings, openai_setting_names, openai_settings } from './openai.js
27import { POPUP_RESULT, POPUP_TYPE, Popup } from './popup.js';27import { POPUP_RESULT, POPUP_TYPE, Popup } from './popup.js';
28import { context_presets, getContextSettings, power_user } from './power-user.js';28import { context_presets, getContextSettings, power_user } from './power-user.js';
29import { reasoning_templates } from './reasoning.js';29import { reasoning_templates } from './reasoning.js';
30import { getManualPresetSamplers, resetPresetSelectedSamplers, setPresetSamplersState } from './samplerSelect.js';
30import { SlashCommand } from './slash-commands/SlashCommand.js';31import { SlashCommand } from './slash-commands/SlashCommand.js';
31import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';32import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
32import { enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';33import { enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
@@ -1071,6 +1072,16 @@ export async function initPresetManager() {
1071 return;1072 return;
1072 }1073 }
10731074
1075 if (apiId === 'textgenerationwebui') {
1076 const manualSamplersIterable = Object.entries(getManualPresetSamplers(oldName));
1077
1078 for (const [sampler, value] of manualSamplersIterable) {
1079 setPresetSamplersState(sampler, value, newName);
1080 }
1081
1082 await resetPresetSelectedSamplers(oldName, true);
1083 }
1084
1074 const successToast = !presetManager.isAdvancedFormatting() ? t`Preset renamed` : t`Template renamed`;1085 const successToast = !presetManager.isAdvancedFormatting() ? t`Preset renamed` : t`Template renamed`;
1075 toastr.success(successToast);1086 toastr.success(successToast);
1076 });1087 });
public/scripts/samplerSelect.js+174 -11
@@ -7,18 +7,19 @@ import { power_user } from './power-user.js';
7//import { getEventSourceStream } from './sse-stream.js';7//import { getEventSourceStream } from './sse-stream.js';
8//import { getSortableDelay, onlyUnique } from './utils.js';8//import { getSortableDelay, onlyUnique } from './utils.js';
9//import { getCfgPrompt } from './cfg-scale.js';9//import { getCfgPrompt } from './cfg-scale.js';
10import { setting_names } from './textgen-settings.js';10import { setting_names as TGsamplerNames, showTGSamplerControls, textgenerationwebui_settings } from './textgen-settings.js';
11import { renderTemplateAsync } from './templates.js';11import { renderTemplateAsync } from './templates.js';
12import { Popup, POPUP_TYPE } from './popup.js';12import { Popup, POPUP_TYPE } from './popup.js';
1313import { localforage } from '../lib.js';
14
15const TGsamplerNames = setting_names;
1614
17const forcedOnColoring = 'color: #89db35;';15const forcedOnColoring = 'color: #89db35;';
18const forcedOffColoring = 'color: #e84f62;';16const forcedOffColoring = 'color: #e84f62;';
1917
20let userDisabledSamplers, userShownSamplers;18let userDisabledSamplers, userShownSamplers;
2119
20const textGenObjectStore = localforage.createInstance({ name: 'SillyTavern_TextCompletions' });
21let selectedSamplers = {};
22
22// Goal 1: show popup with all samplers for active API23// Goal 1: show popup with all samplers for active API
23async function showSamplerSelectPopup() {24async function showSamplerSelectPopup() {
24 const html = $(document.createElement('div'));25 const html = $(document.createElement('div'));
@@ -41,6 +42,12 @@ async function showSamplerSelectPopup() {
41 userShownSamplers = [];42 userShownSamplers = [];
42 power_user.selectSamplers.forceShown = [];43 power_user.selectSamplers.forceShown = [];
43 power_user.selectSamplers.forceHidden = [];44 power_user.selectSamplers.forceHidden = [];
45
46 if (main_api === 'textgenerationwebui') {
47 $('#prioritizeManuallySelectedSamplers').toggleClass('toggleEnabled', false);
48 await resetPresetSelectedSamplers(null, true);
49 }
50
44 await validateDisabledSamplers(true);51 await validateDisabledSamplers(true);
45 });52 });
4653
@@ -53,7 +60,23 @@ async function showSamplerSelectPopup() {
53 await validateDisabledSamplers();60 await validateDisabledSamplers();
54 });61 });
5562
63 if (main_api === 'textgenerationwebui') {
64 $('#prioritizeManuallySelectedSamplers').show();
65 $('#prioritizeManuallySelectedSamplers').toggleClass('toggleEnabled', isSamplerManualPriorityEnabled());
66 $('#prioritizeManuallySelectedSamplers').off('click').on('click', function () {
67 $(this).toggleClass('toggleEnabled');
68
69 const isActive = $(this).hasClass('toggleEnabled');
70
71 toggleSamplerManualPriority(isActive);
72 });
73 } else {
74 $('#prioritizeManuallySelectedSamplers').hide();
75 $('#prioritizeManuallySelectedSamplers').off('click');
76 }
77
56 await showPromise;78 await showPromise;
79 if (main_api === 'textgenerationwebui') await savePresetSelectedSamplers();
57}80}
5881
59function setSamplerListListeners() {82function setSamplerListListeners() {
@@ -180,6 +203,10 @@ function setSamplerListListeners() {
180 const shouldDisplay = $(this).prop('checked') ? targetDisplayType : 'none';203 const shouldDisplay = $(this).prop('checked') ? targetDisplayType : 'none';
181 relatedDOMElement.css('display', shouldDisplay);204 relatedDOMElement.css('display', shouldDisplay);
182205
206 if (main_api === 'textgenerationwebui') {
207 setPresetSamplersState(samplerName, shouldDisplay !== 'none');
208 }
209
183 console.log(samplerName, relatedDOMElement.data('selectsampler'), shouldDisplay);210 console.log(samplerName, relatedDOMElement.data('selectsampler'), shouldDisplay);
184 });211 });
185212
@@ -210,6 +237,9 @@ async function listSamplers(main_api, arrayOnly = false) {
210 return availableSamplers;237 return availableSamplers;
211 }238 }
212239
240 const samplersActivatedManually = (main_api === 'textgenerationwebui') ? getManualActivePresetSamplers() : [];
241 const prioritizeManualSamplerSelect = (main_api === 'textgenerationwebui') ? isSamplerManualPriorityEnabled() : false;
242
213 const samplersListHTML = availableSamplers.reduce((html, sampler) => {243 const samplersListHTML = availableSamplers.reduce((html, sampler) => {
214 let customColor, displayname;244 let customColor, displayname;
215 let targetDOMelement = $(`#${sampler}_${main_api}`);245 let targetDOMelement = $(`#${sampler}_${main_api}`);
@@ -283,8 +313,7 @@ async function listSamplers(main_api, arrayOnly = false) {
283 displayname = 'Mirostat Block';313 displayname = 'Mirostat Block';
284 }314 }
285315
286316 const isManuallyActivated = samplersActivatedManually.includes(sampler);
287
288 const isInForceHiddenArray = userDisabledSamplers.includes(sampler);317 const isInForceHiddenArray = userDisabledSamplers.includes(sampler);
289 const isInForceShownArray = userShownSamplers.includes(sampler);318 const isInForceShownArray = userShownSamplers.includes(sampler);
290 let isVisibleInDOM = isElementVisibleInDOM(targetDOMelement[0]);319 let isVisibleInDOM = isElementVisibleInDOM(targetDOMelement[0]);
@@ -295,7 +324,10 @@ async function listSamplers(main_api, arrayOnly = false) {
295 };324 };
296325
297 const shouldBeChecked = () => {326 const shouldBeChecked = () => {
298 if (isInForceHiddenArray) {327 if (prioritizeManualSamplerSelect) {
328 return isManuallyActivated;
329 }
330 else if (isInForceHiddenArray) {
299 customColor = forcedOffColoring;331 customColor = forcedOffColoring;
300 return false;332 return false;
301 }333 }
@@ -307,6 +339,7 @@ async function listSamplers(main_api, arrayOnly = false) {
307 };339 };
308 console.log(sampler, targetDOMelement.prop('id'), isInDefaultState(), isInForceShownArray, isInForceHiddenArray, shouldBeChecked());340 console.log(sampler, targetDOMelement.prop('id'), isInDefaultState(), isInForceShownArray, isInForceHiddenArray, shouldBeChecked());
309 if (displayname === undefined) { displayname = sampler; }341 if (displayname === undefined) { displayname = sampler; }
342 if (main_api === 'textgenerationwebui') setPresetSamplersState(sampler, shouldBeChecked());
310 return html + `343 return html + `
311 <div class="sampler_view_list_item wide50p flex-container">344 <div class="sampler_view_list_item wide50p flex-container">
312 <input type="checkbox" name="${sampler}_checkbox" ${shouldBeChecked() ? 'checked' : ''}>345 <input type="checkbox" name="${sampler}_checkbox" ${shouldBeChecked() ? 'checked' : ''}>
@@ -328,6 +361,9 @@ export async function validateDisabledSamplers(redraw = false) {
328 return;361 return;
329 }362 }
330363
364 const samplersActivatedManually = (main_api === 'textgenerationwebui') ? getManualActivePresetSamplers() : [];
365 const prioritizeManualSamplerSelect = (main_api === 'textgenerationwebui') ? isSamplerManualPriorityEnabled() : false;
366
331 for (const sampler of APISamplers) {367 for (const sampler of APISamplers) {
332 let relatedDOMElement = $(`#${sampler}_${main_api}`).parent();368 let relatedDOMElement = $(`#${sampler}_${main_api}`).parent();
333 let targetDisplayType = 'flex';369 let targetDisplayType = 'flex';
@@ -400,6 +436,7 @@ export async function validateDisabledSamplers(redraw = false) {
400 relatedDOMElement = $('#smoothingBlock');436 relatedDOMElement = $('#smoothingBlock');
401 }437 }
402438
439
403 if (power_user?.selectSamplers?.forceHidden.includes(sampler)) {440 if (power_user?.selectSamplers?.forceHidden.includes(sampler)) {
404 //default handling for standard sliders441 //default handling for standard sliders
405 relatedDOMElement.data('selectsampler', 'hidden');442 relatedDOMElement.data('selectsampler', 'hidden');
@@ -417,20 +454,147 @@ export async function validateDisabledSamplers(redraw = false) {
417 relatedDOMElement.css('display', 'none');454 relatedDOMElement.css('display', 'none');
418 }455 }
419 }456 }
457
458 if (prioritizeManualSamplerSelect) {
459 const isManuallyActivated = samplersActivatedManually.includes(sampler);
460 relatedDOMElement.css('display', isManuallyActivated ? targetDisplayType : 'none');
461 }
462 }
463
420 if (redraw) {464 if (redraw) {
465 if (main_api === 'textgenerationwebui') showTGSamplerControls();
466
421 let samplersHTML = await listSamplers(main_api);467 let samplersHTML = await listSamplers(main_api);
422 $('#apiSamplersList').empty().append(samplersHTML.toString());468 $('#apiSamplersList').empty().append(samplersHTML.toString());
423 setSamplerListListeners();469 setSamplerListListeners();
424 }470 }
425471
426 await saveSettingsDebounced();472 await saveSettingsDebounced();
427
428 }
429}473}
430474
475/**
476 * Initializes the configuration object for manually selected samplers.
477 */
478export async function loadPresetSelectedSamplers() {
479 try {
480 console.debug('Text Completions: loading selected samplers');
481 selectedSamplers = await textGenObjectStore.getItem('selectedSamplers') || {};
482 } catch (error) {
483 console.log('Text Completions: unable to load selected samplers, using default samplers', error);
484 selectedSamplers = {};
485 }
486}
487
488/**
489 * Synchronizes the local forage instance with the selected samplers configuration object.
490 */
491export async function savePresetSelectedSamplers() {
492 try {
493 console.debug('Text Completions: saving selected samplers');
494 await textGenObjectStore.setItem('selectedSamplers', selectedSamplers);
495 } catch (error) {
496 console.log('Text Completions: unable to save selected samplers', error);
497 }
498}
499
500/**
501 * Resets the selected samplers configuration object from the local forage instance.
502 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
503 * @param {boolean} silent Suppresses the toastr message confirming that the data was deleted.
504 */
505export async function resetPresetSelectedSamplers(presetName = '', silent = false) {
506 try {
507 if (!textgenerationwebui_settings?.preset && !presetName) return;
508 if (!presetName) presetName = textgenerationwebui_settings.preset;
509 if (!selectedSamplers[presetName]) return;
510
511 console.debug('Text Completions: resetting selected samplers');
512 delete selectedSamplers[presetName];
513 await savePresetSelectedSamplers();
514 if (!silent) toastr.success('Selected samplers cleared.');
515 } catch (error) {
516 console.log('Text Completions: unable to reset selected preset samplers', error);
517 }
518}
519
520/**
521 * Saves the visibility state for selected samplers into the configuration object.
522 * @param {string} samplerName Target sampler key name
523 * @param {string|boolean} state Visibility state of the target sampler
524 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
525 * @returns void
526 */
527export function setPresetSamplersState(samplerName, state, presetName = '') {
528 if (!textgenerationwebui_settings?.preset && !presetName) return;
529 if (!presetName) presetName = textgenerationwebui_settings.preset;
530 if (!selectedSamplers[presetName]) selectedSamplers[presetName] = {};
531
532 const presetSamplers = selectedSamplers[presetName];
533 presetSamplers[samplerName] = String(state) === 'true';
534}
535
536/**
537 * Returns the local forage object belonging to the active/selected TC preset
538 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
539 * @returns {object} Full localforage object with manual selections
540 */
541export function getManualPresetSamplers(presetName = '') {
542 if (!textgenerationwebui_settings?.preset && !presetName) return {};
543 if (!presetName) presetName = textgenerationwebui_settings.preset;
544 if (!selectedSamplers[presetName]) selectedSamplers[presetName] = {};
545
546 return selectedSamplers[presetName];
547}
548
549/**
550 * Returns the key names of all the preset samplers activated manually.
551 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
552 * @returns {string[]} Array of sampler key names
553 */
554export function getManualActivePresetSamplers(presetName = '') {
555 if (!textgenerationwebui_settings?.preset && !presetName) return [];
556 if (!presetName) presetName = textgenerationwebui_settings.preset;
557 if (!selectedSamplers[presetName]) selectedSamplers[presetName] = {};
558
559 try {
560 const presetSamplers = Object.entries(selectedSamplers[presetName]);
561
562 return presetSamplers
563 .filter(([key, val]) => val === true && key !== 'st_manual_priority')
564 .map(([key, val]) => key);
565 } catch (error) {
566 console.log('Text Completions: unable to fetch active preset samplers', error);
567 return [];
568 }
569}
570
571/**
572 * @param {string|boolean} state Target state of the feature
573 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
574 * @returns void
575 */
576export function toggleSamplerManualPriority(state = false, presetName = '') {
577 if (!textgenerationwebui_settings?.preset && !presetName) return;
578 if (!presetName) presetName = textgenerationwebui_settings.preset;
579 if (!selectedSamplers[presetName]) selectedSamplers[presetName] = {};
580
581 const presetSamplers = selectedSamplers[presetName];
582 presetSamplers.st_manual_priority = String(state) === 'true';
583}
584
585/**
586 * @param {string?} presetName Name of the target preset - It picks the current active TC preset name by default
587 * @returns {boolean}
588 */
589export function isSamplerManualPriorityEnabled(presetName = '') {
590 if (!textgenerationwebui_settings?.preset && !presetName) return false;
591 if (!presetName) presetName = textgenerationwebui_settings.preset;
592 if (!selectedSamplers[presetName]) selectedSamplers[presetName] = {};
593
594 return selectedSamplers[presetName]?.st_manual_priority ?? false;
595}
431596
432export async function initCustomSelectedSamplers() {597export async function initCustomSelectedSamplers() {
433
434 userDisabledSamplers = power_user?.selectSamplers?.forceHidden || [];598 userDisabledSamplers = power_user?.selectSamplers?.forceHidden || [];
435 userShownSamplers = power_user?.selectSamplers?.forceShown || [];599 userShownSamplers = power_user?.selectSamplers?.forceShown || [];
436 power_user.selectSamplers = {};600 power_user.selectSamplers = {};
@@ -438,7 +602,6 @@ export async function initCustomSelectedSamplers() {
438 power_user.selectSamplers.forceShown = userShownSamplers;602 power_user.selectSamplers.forceShown = userShownSamplers;
439 await saveSettingsDebounced();603 await saveSettingsDebounced();
440 $('#samplerSelectButton').off('click').on('click', showSamplerSelectPopup);604 $('#samplerSelectButton').off('click').on('click', showSamplerSelectPopup);
441
442}605}
443606
444// Goal 4: filter hidden samplers from API output607// Goal 4: filter hidden samplers from API output
public/scripts/templates/samplerSelector.html+7 -1
@@ -1,10 +1,16 @@
1<div class="title_restorable flexFlowColumn alignItemsBaseline">1<div class="title_restorable flexFlowColumn alignItemsBaseline">
2 <div class="flex-container justifyCenter">2 <div class="flex-container justifySpaceBetween alignItemsBaseline wide100p">
3 <h3 data-i18n="Sampler Select">Sampler Select</h3>3 <h3 data-i18n="Sampler Select">Sampler Select</h3>
4 <div class="flex-container alignItemsBaseline">4 <div class="flex-container alignItemsBaseline">
5 <div id="resetSelectedSamplers" class="menu_button menu_button_icon" data-i18n="[title]Reset custom sampler selection" title="Reset custom sampler selection">5 <div id="resetSelectedSamplers" class="menu_button menu_button_icon" data-i18n="[title]Reset custom sampler selection" title="Reset custom sampler selection">
6 <i class="fa-solid fa-recycle"></i>6 <i class="fa-solid fa-recycle"></i>
7 <span data-i18n="Reset">Reset</span>
7 </div>8 </div>
9 <div id="prioritizeManuallySelectedSamplers" class="menu_button menu_button_icon" data-i18n="[title]Prioritize showing samplers manually selected from this popup." title="Prioritize showing samplers manually selected from this popup.">
10 <i class="fa-solid fa-lock"></i>
11 <span data-i18n="Prioritize">Prioritize</span>
12 </div>
13 <div class="margin5 fa-solid fa-exclamation-circle" data-i18n="[title]Toggle on to force the samplers selected in this menu to be shown when switching to this preset. By default, SillyTavern automatically selects samplers used or needed by the selected API Type in the API Connections panel." title="Toggle on to force the samplers selected in this menu to be shown when switching to this preset. By default, SillyTavern automatically selects samplers used or needed by the selected API Type in the API Connections panel."></div>
8 </div>14 </div>
9 <!--<div class="flex-container alignItemsBaseline">15 <!--<div class="flex-container alignItemsBaseline">
10 <div class="menu_button menu_button_icon" title="Create a new sampler">16 <div class="menu_button menu_button_icon" title="Create a new sampler">
public/scripts/textgen-settings.js+43 -2
@@ -20,6 +20,7 @@ import { autoSelectInstructPreset, selectContextPreset, selectInstructPreset } f
20import { BIAS_CACHE, createNewLogitBiasEntry, displayLogitBias, getLogitBiasListResult } from './logit-bias.js';20import { BIAS_CACHE, createNewLogitBiasEntry, displayLogitBias, getLogitBiasListResult } from './logit-bias.js';
2121
22import { power_user, registerDebugFunction } from './power-user.js';22import { power_user, registerDebugFunction } from './power-user.js';
23import { getManualActivePresetSamplers, isSamplerManualPriorityEnabled, loadPresetSelectedSamplers } from './samplerSelect.js';
23import { SECRET_KEYS, writeSecret } from './secrets.js';24import { SECRET_KEYS, writeSecret } from './secrets.js';
24import { getEventSourceStream } from './sse-stream.js';25import { getEventSourceStream } from './sse-stream.js';
25import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer, loadAphroditeModels, loadDreamGenModels, loadFeatherlessModels, loadGenericModels, loadInfermaticAIModels, loadMancerModels, loadOllamaModels, loadOpenRouterModels, loadTabbyModels, loadTogetherAIModels, loadVllmModels } from './textgen-models.js';26import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer, loadAphroditeModels, loadDreamGenModels, loadFeatherlessModels, loadGenericModels, loadInfermaticAIModels, loadMancerModels, loadOllamaModels, loadOpenRouterModels, loadTabbyModels, loadTogetherAIModels, loadVllmModels } from './textgen-models.js';
@@ -230,6 +231,7 @@ const settings = {
230231
231export {232export {
232 settings as textgenerationwebui_settings,233 settings as textgenerationwebui_settings,
234 showSamplerControls as showTGSamplerControls,
233};235};
234236
235export let textgenerationwebui_banned_in_macros = [];237export let textgenerationwebui_banned_in_macros = [];
@@ -370,6 +372,7 @@ async function selectPreset(name) {
370 setSettingByName(name, value, true);372 setSettingByName(name, value, true);
371 }373 }
372 setGenerationParamsFromPreset(preset);374 setGenerationParamsFromPreset(preset);
375 showSamplerControls(null, true);
373 BIAS_CACHE.delete(BIAS_KEY);376 BIAS_CACHE.delete(BIAS_KEY);
374 displayLogitBias(preset.logit_bias, BIAS_KEY);377 displayLogitBias(preset.logit_bias, BIAS_KEY);
375 saveSettingsDebounced();378 saveSettingsDebounced();
@@ -569,7 +572,8 @@ export function loadTextGenSettings(data, loadedSettings) {
569572
570 $('#textgen_type').val(settings.type);573 $('#textgen_type').val(settings.type);
571 $('#openrouter_providers_text').val(settings.openrouter_providers).trigger('change');574 $('#openrouter_providers_text').val(settings.openrouter_providers).trigger('change');
572 showTypeSpecificControls(settings.type);575 loadPresetSelectedSamplers();
576 showSamplerControls();
573 BIAS_CACHE.delete(BIAS_KEY);577 BIAS_CACHE.delete(BIAS_KEY);
574 displayLogitBias(settings.logit_bias, BIAS_KEY);578 displayLogitBias(settings.logit_bias, BIAS_KEY);
575579
@@ -775,6 +779,8 @@ async function getStatusTextgen() {
775}779}
776780
777export function initTextGenSettings() {781export function initTextGenSettings() {
782 loadPresetSelectedSamplers();
783
778 $('#send_banned_tokens_textgenerationwebui').on('change', function () {784 $('#send_banned_tokens_textgenerationwebui').on('change', function () {
779 const checked = !!$(this).prop('checked');785 const checked = !!$(this).prop('checked');
780 toggleBannedStringsKillSwitch(checked,786 toggleBannedStringsKillSwitch(checked,
@@ -902,7 +908,7 @@ export function initTextGenSettings() {
902 }908 }
903 }909 }
904910
905 showTypeSpecificControls(type);911 showSamplerControls(type);
906 setOnlineStatus('no_connection');912 setOnlineStatus('no_connection');
907 BIAS_CACHE.delete(BIAS_KEY);913 BIAS_CACHE.delete(BIAS_KEY);
908914
@@ -1069,6 +1075,41 @@ export function initTextGenSettings() {
1069 });1075 });
1070}1076}
10711077
1078/**
1079 * Hides and shows preset samplers from the left panel.
1080 * @param {string?} apiType API Type selected in API Connections - Currently selected one by default
1081 * @param {boolean?} isPresetSwitch Wheter the trigger comes from a preset switch - false by default
1082 * @returns void
1083 */
1084function showSamplerControls(apiType = null, isPresetSwitch = false) {
1085 const prioritizeManualSamplerSelect = isSamplerManualPriorityEnabled();
1086
1087 if (isPresetSwitch && !prioritizeManualSamplerSelect) return;
1088
1089 $('#textgenerationwebui_api-settings [data-tg-samplers]:not([data-tg-type])').each(function() {
1090 $(this).show();
1091 });
1092
1093 showTypeSpecificControls(apiType ?? settings.type);
1094
1095 const samplersActivatedManually = getManualActivePresetSamplers();
1096
1097 if (!samplersActivatedManually?.length || !prioritizeManualSamplerSelect) return;
1098
1099 $('#textgenerationwebui_api-settings [data-tg-samplers]').each(function() {
1100 const tgSamplers = $(this).attr('data-tg-samplers').split(',').map(x => x.trim()).filter(str => str !== '');
1101
1102 for (const tgSampler of tgSamplers) {
1103 if (samplersActivatedManually.includes(tgSampler)) {
1104 $(this).show();
1105 return;
1106 } else {
1107 $(this).hide();
1108 }
1109 }
1110 });
1111}
1112
1072function showTypeSpecificControls(type) {1113function showTypeSpecificControls(type) {
1073 $('[data-tg-type]').each(function () {1114 $('[data-tg-type]').each(function () {
1074 const mode = String($(this).attr('data-tg-type-mode') ?? '').toLowerCase().trim();1115 const mode = String($(this).attr('data-tg-type-mode') ?? '').toLowerCase().trim();