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 @@
1376 </div>1376 </div>
1377 </div>1377 </div>
13781378
1379 <div data-tg-type="koboldcpp, aphrodite, tabby, ooba" id="xtc_block" class="wide100p">1379 <div data-tg-type="koboldcpp, aphrodite, tabby, ooba, llamacpp" id="xtc_block" class="wide100p">
1380 <h4 class="wide100p textAlignCenter">1380 <h4 class="wide100p textAlignCenter">
1381 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>1381 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
1382 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">1382 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@@ -1730,6 +1730,7 @@
1730 <div data-name="typical_p" draggable="true"><span>Typical P</span><small></small></div>1730 <div data-name="typical_p" draggable="true"><span>Typical P</span><small></small></div>
1731 <div data-name="tfs_z" draggable="true"><span>Tail Free Sampling</span><small></small></div>1731 <div data-name="tfs_z" draggable="true"><span>Tail Free Sampling</span><small></small></div>
1732 <div data-name="min_p" draggable="true"><span>Min P</span><small></small></div>1732 <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>
1733 </div>1734 </div>
1734 <div id="llamacpp_samplers_default_order" class="menu_button menu_button_icon">1735 <div id="llamacpp_samplers_default_order" class="menu_button menu_button_icon">
1735 <span data-i18n="Load default order">Load default order</span>1736 <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 = [
65 'typical_p',65 'typical_p',
66 'top_p',66 'top_p',
67 'min_p',67 'min_p',
68 'xtc',
68 'temperature',69 'temperature',
69];70];
70const OOBA_DEFAULT_ORDER = [71const OOBA_DEFAULT_ORDER = [
@@ -834,6 +835,7 @@ function setSettingByName(setting, value, trigger) {
834835
835 if ('samplers' === setting) {836 if ('samplers' === setting) {
836 value = Array.isArray(value) ? value : LLAMACPP_DEFAULT_ORDER;837 value = Array.isArray(value) ? value : LLAMACPP_DEFAULT_ORDER;
838 insertMissingArrayItems(LLAMACPP_DEFAULT_ORDER, value);
837 sortLlamacppItemsByOrder(value);839 sortLlamacppItemsByOrder(value);
838 settings.samplers = value;840 settings.samplers = value;
839 return;841 return;