Merge pull request #1909 from ThisIsPIRI/unlock

Prevent presets without a max context/response value from unchecking unlocked context
This commit is contained in:
Cohee 2024-03-09 21:14:00 +02:00 committed by GitHub
commit cdbb979a3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -5960,7 +5960,7 @@ async function saveSettings(type) {
}
export function setGenerationParamsFromPreset(preset) {
const needsUnlock = preset.max_length > MAX_CONTEXT_DEFAULT || preset.genamt > MAX_RESPONSE_DEFAULT;
const needsUnlock = (preset.max_length ?? max_context) > MAX_CONTEXT_DEFAULT || (preset.genamt ?? amount_gen) > MAX_RESPONSE_DEFAULT;
$('#max_context_unlocked').prop('checked', needsUnlock).trigger('change');
if (preset.genamt !== undefined) {