Update llama.cpp textgen settings

* Add min_keep, a llama.cpp-exclusive setting for constraining the effect of truncation samplers
* Enable nsigma for llama.cpp, and add llama.cpp alias top_n_sigma, add nsigma to the llama.cpp sampler order block
* Allow a negative value of nsigma as this represents 'disabled' in llama.cpp (while 0 is deterministic)
* Remove tfs and top_a as these are not supported by llama.cpp (tfs was removed, and top_a was never supported)
* Correct the identification string for typical_p in the llama.cpp sampler order block
* Add penalties to the llama.cpp sampler order block
This commit is contained in:
DocShotgun
2025-05-06 00:32:29 -07:00
parent 6625e4036e
commit bf66a39579
2 changed files with 25 additions and 10 deletions

View File

@@ -56,10 +56,11 @@ const {
} = textgen_types;
const LLAMACPP_DEFAULT_ORDER = [
'penalties',
'dry',
'top_n_sigma',
'top_k',
'tfs_z',
'typical_p',
'typ_p',
'top_p',
'min_p',
'xtc',
@@ -212,6 +213,7 @@ const settings = {
xtc_threshold: 0.1,
xtc_probability: 0,
nsigma: 0.0,
min_keep: 0,
featherless_model: '',
generic_model: '',
};
@@ -294,6 +296,7 @@ export const setting_names = [
'xtc_threshold',
'xtc_probability',
'nsigma',
'min_keep',
'generic_model',
];
@@ -803,7 +806,8 @@ jQuery(function () {
'dry_penalty_last_n_textgenerationwebui': 0,
'xtc_threshold_textgenerationwebui': 0.1,
'xtc_probability_textgenerationwebui': 0,
'nsigma_textgenerationwebui': 0,
'nsigma_textgenerationwebui': [LLAMACPP].includes(settings.type) ? -0.01 : 0,
'min_keep_textgenerationwebui': 0,
};
for (const [id, value] of Object.entries(inputs)) {
@@ -1332,6 +1336,8 @@ export async function getTextGenGenerationData(finalPrompt, maxTokens, isImperso
'xtc_threshold': settings.xtc_threshold,
'xtc_probability': settings.xtc_probability,
'nsigma': settings.nsigma,
'top_n_sigma': settings.nsigma,
'min_keep': settings.min_keep,
};
const nonAphroditeParams = {
'rep_pen': settings.rep_pen,