don't force amt_gen to model max on mancer model swap

This commit is contained in:
RossAscends 2024-04-18 11:10:17 +09:00
parent 8a4b675143
commit 75afe29f28
2 changed files with 11 additions and 5 deletions

View File

@ -6353,14 +6353,20 @@ async function saveSettings(type) {
});
}
export function setGenerationParamsFromPreset(preset) {
export function setGenerationParamsFromPreset(preset, isMancerChange = null) {
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) {
amount_gen = preset.genamt;
$('#amount_gen').val(amount_gen);
$('#amount_gen_counter').val(amount_gen);
if (isMancerChange) {
$('#amount_gen').attr('max', amount_gen);
$('#amount_gen_counter').val($('#amount_gen').val());
}
else {
$('#amount_gen').val(amount_gen);
$('#amount_gen_counter').val(amount_gen);
}
}
if (preset.max_length !== undefined) {

View File

@ -184,7 +184,7 @@ function onMancerModelSelect() {
$('#api_button_textgenerationwebui').trigger('click');
const limits = mancerModels.find(x => x.id === modelId)?.limits;
setGenerationParamsFromPreset({ max_length: limits.context, genamt: limits.completion });
setGenerationParamsFromPreset({ max_length: limits.context, genamt: limits.completion }, true);
}
function onTogetherModelSelect() {
@ -461,7 +461,7 @@ jQuery(function () {
searchInputPlaceholder: 'Search models...',
searchInputCssClass: 'text_pole',
width: '100%',
templateResult: getDreamGenModelTemplate,
templateResult: getDreamGenModelTemplate,
});
$('#openrouter_model').select2({
placeholder: 'Select a model',