mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix model restoration on load
This commit is contained in:
@ -1652,7 +1652,8 @@ function saveModelList(data) {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!oai_settings.nanogpt_model && model_list.length > 0) {
|
const selectedModel = model_list.find(model => model.id === oai_settings.nanogpt_model);
|
||||||
|
if (model_list.length > 0 && (!selectedModel || !oai_settings.nanogpt_model)) {
|
||||||
oai_settings.nanogpt_model = model_list[0].id;
|
oai_settings.nanogpt_model = model_list[0].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4010,6 +4011,11 @@ async function onModelChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).is('#model_nanogpt_select')) {
|
if ($(this).is('#model_nanogpt_select')) {
|
||||||
|
if (!value) {
|
||||||
|
console.debug('Null NanoGPT model selected. Ignoring.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.log('NanoGPT model changed to', value);
|
console.log('NanoGPT model changed to', value);
|
||||||
oai_settings.nanogpt_model = value;
|
oai_settings.nanogpt_model = value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user