Merge pull request #2993 from theo77186/llamacpp_xtc Enable XTC support for llama.cpp

725cfdebca753c5ef37483964b4926910d1c4814

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
2 files changed, +4 -1Showing whitespace changes
public/index.html+2 -1
@@ -1376,7 +1376,7 @@
13761376 </div>
13771377 </div>
13781378
13791379 <div data-tg-type="koboldcpp, aphrodite, tabby, ooba, llamacpp" id="xtc_block" class="wide100p">
13801380 <h4 class="wide100p textAlignCenter">
13811381 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
13821382 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@@ -1730,6 +1730,7 @@
17301730 <div data-name="typical_p" draggable="true"><span>Typical P</span><small></small></div>
17311731 <div data-name="tfs_z" draggable="true"><span>Tail Free Sampling</span><small></small></div>
17321732 <div data-name="min_p" draggable="true"><span>Min P</span><small></small></div>
1733+ <div data-name="xtc" draggable="true"><span>Exclude Top Choices</span><small></small></div>
17331734 </div>
17341735 <div id="llamacpp_samplers_default_order" class="menu_button menu_button_icon">
17351736 <span data-i18n="Load default order">Load default order</span>
public/scripts/textgen-settings.js+2 -0
@@ -65,6 +65,7 @@ const LLAMACPP_DEFAULT_ORDER = [
6565 'typical_p',
6666 'top_p',
6767 'min_p',
68+ 'xtc',
6869 'temperature',
6970];
7071const OOBA_DEFAULT_ORDER = [
@@ -834,6 +835,7 @@ function setSettingByName(setting, value, trigger) {
834835
835836 if ('samplers' === setting) {
836837 value = Array.isArray(value) ? value : LLAMACPP_DEFAULT_ORDER;
838+ insertMissingArrayItems(LLAMACPP_DEFAULT_ORDER, value);
837839 sortLlamacppItemsByOrder(value);
838840 settings.samplers = value;
839841 return;