Merge pull request #2993 from theo77186/llamacpp_xtc

Enable XTC support for llama.cpp
This commit is contained in:
Cohee 2024-10-16 20:52:06 +03:00 committed by GitHub
commit 725cfdebca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -1376,7 +1376,7 @@
</div> </div>
</div> </div>
<div data-tg-type="koboldcpp, aphrodite, tabby, ooba" id="xtc_block" class="wide100p"> <div data-tg-type="koboldcpp, aphrodite, tabby, ooba, llamacpp" id="xtc_block" class="wide100p">
<h4 class="wide100p textAlignCenter"> <h4 class="wide100p textAlignCenter">
<label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label> <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
<a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank"> <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
@ -1730,6 +1730,7 @@
<div data-name="typical_p" draggable="true"><span>Typical P</span><small></small></div> <div data-name="typical_p" draggable="true"><span>Typical P</span><small></small></div>
<div data-name="tfs_z" draggable="true"><span>Tail Free Sampling</span><small></small></div> <div data-name="tfs_z" draggable="true"><span>Tail Free Sampling</span><small></small></div>
<div data-name="min_p" draggable="true"><span>Min P</span><small></small></div> <div data-name="min_p" draggable="true"><span>Min P</span><small></small></div>
<div data-name="xtc" draggable="true"><span>Exclude Top Choices</span><small></small></div>
</div> </div>
<div id="llamacpp_samplers_default_order" class="menu_button menu_button_icon"> <div id="llamacpp_samplers_default_order" class="menu_button menu_button_icon">
<span data-i18n="Load default order">Load default order</span> <span data-i18n="Load default order">Load default order</span>

View File

@ -65,6 +65,7 @@ const LLAMACPP_DEFAULT_ORDER = [
'typical_p', 'typical_p',
'top_p', 'top_p',
'min_p', 'min_p',
'xtc',
'temperature', 'temperature',
]; ];
const OOBA_DEFAULT_ORDER = [ const OOBA_DEFAULT_ORDER = [
@ -834,6 +835,7 @@ function setSettingByName(setting, value, trigger) {
if ('samplers' === setting) { if ('samplers' === setting) {
value = Array.isArray(value) ? value : LLAMACPP_DEFAULT_ORDER; value = Array.isArray(value) ? value : LLAMACPP_DEFAULT_ORDER;
insertMissingArrayItems(LLAMACPP_DEFAULT_ORDER, value);
sortLlamacppItemsByOrder(value); sortLlamacppItemsByOrder(value);
settings.samplers = value; settings.samplers = value;
return; return;