mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Less strict rules for logit bias files import
This commit is contained in:
@ -2324,18 +2324,17 @@ async function onLogitBiasPresetImportFileChange(e) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validEntries = [];
|
||||||
|
|
||||||
for (const entry of importedFile) {
|
for (const entry of importedFile) {
|
||||||
if (typeof entry == 'object') {
|
if (typeof entry == 'object' && entry !== null) {
|
||||||
if (entry.hasOwnProperty('text') && entry.hasOwnProperty('value')) {
|
if (entry.hasOwnProperty('text') && entry.hasOwnProperty('value')) {
|
||||||
continue;
|
validEntries.push(entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callPopup('Invalid logit bias preset file.', 'text');
|
oai_settings.bias_presets[name] = validEntries;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
oai_settings.bias_presets[name] = importedFile;
|
|
||||||
oai_settings.bias_preset_selected = name;
|
oai_settings.bias_preset_selected = name;
|
||||||
|
|
||||||
addLogitBiasPresetOption(name);
|
addLogitBiasPresetOption(name);
|
||||||
|
Reference in New Issue
Block a user