mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-08 07:32:34 +01:00
Less strict rules for logit bias files import
This commit is contained in:
parent
f633f62065
commit
b385bd190a
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user