Merge pull request #3593 from SillyTavern/tc-missing-samplers-on-restore

Add missing samplers to TC restore preset
This commit is contained in:
Cohee
2025-03-02 23:02:20 +02:00
committed by GitHub

View File

@@ -803,16 +803,18 @@ jQuery(function () {
'dry_penalty_last_n_textgenerationwebui': 0, 'dry_penalty_last_n_textgenerationwebui': 0,
'xtc_threshold_textgenerationwebui': 0.1, 'xtc_threshold_textgenerationwebui': 0.1,
'xtc_probability_textgenerationwebui': 0, 'xtc_probability_textgenerationwebui': 0,
'nsigma_textgenerationwebui': 0,
}; };
for (const [id, value] of Object.entries(inputs)) { for (const [id, value] of Object.entries(inputs)) {
const inputElement = $(`#${id}`); const inputElement = $(`#${id}`);
const valueToSet = typeof value === 'boolean' ? String(value) : value;
if (inputElement.prop('type') === 'checkbox') { if (inputElement.prop('type') === 'checkbox') {
inputElement.prop('checked', value).trigger('input'); inputElement.prop('checked', value).trigger('input');
} else if (inputElement.prop('type') === 'number') { } else if (inputElement.prop('type') === 'number') {
inputElement.val(value).trigger('input'); inputElement.val(valueToSet).trigger('input');
} else { } else {
inputElement.val(value).trigger('input'); inputElement.val(valueToSet).trigger('input');
if (power_user.enableZenSliders) { if (power_user.enableZenSliders) {
let masterElementID = inputElement.prop('id'); let masterElementID = inputElement.prop('id');
console.log(masterElementID); console.log(masterElementID);