From 314b194891e470601c947eacae6280b99b229cf1 Mon Sep 17 00:00:00 2001 From: Cohee Date: Sat, 29 Jul 2023 21:24:29 +0300 Subject: [PATCH 1/3] Remove preset reloading when setting is NaN --- public/scripts/nai-settings.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/public/scripts/nai-settings.js b/public/scripts/nai-settings.js index 427c61563..0afe52b03 100644 --- a/public/scripts/nai-settings.js +++ b/public/scripts/nai-settings.js @@ -90,13 +90,6 @@ function loadNovelSettings(settings) { nai_settings.cfg_scale = settings.cfg_scale; nai_settings.streaming_novel = !!settings.streaming_novel; loadNovelSettingsUi(nai_settings); - - // reload the preset to migrate any new settings - for (const key of Object.keys(nai_settings)) { - if (typeof nai_settings[key] === 'number' && Number.isNaN(nai_settings[key])) { - $("#settings_perset_novel").trigger("change"); - } - } } const phraseRepPenStrings = [ From df8d7075a80dae782bf59ce9aa6ee3925766d6ae Mon Sep 17 00:00:00 2001 From: Cohee Date: Sat, 29 Jul 2023 22:50:07 +0300 Subject: [PATCH 2/3] Handle 451 from OpenRouter --- server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.js b/server.js index 37f1586da..0584ccba7 100644 --- a/server.js +++ b/server.js @@ -3260,6 +3260,10 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op message = 'API key disabled or exhausted'; console.log(message); break; + case 451: + message = error?.response?.data?.error?.message || 'Unavailable for legal reasons'; + console.log(message); + break; } const quota_error = error?.response?.status === 429 && error?.response?.data?.error?.type === 'insufficient_quota'; From f36cf088a10afe5e12b8b6de2f8074fe0d559d6e Mon Sep 17 00:00:00 2001 From: Cohee Date: Sat, 29 Jul 2023 22:50:52 +0300 Subject: [PATCH 3/3] Bump package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c091c2615..a803cc4a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sillytavern", - "version": "1.9.2", + "version": "1.9.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sillytavern", - "version": "1.9.2", + "version": "1.9.3", "license": "AGPL-3.0", "dependencies": { "@dqbd/tiktoken": "^1.0.2", diff --git a/package.json b/package.json index c5761758f..05dcec7bf 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "type": "git", "url": "https://github.com/SillyTavern/SillyTavern.git" }, - "version": "1.9.2", + "version": "1.9.3", "scripts": { "start": "node server.js", "pkg": "pkg --compress Gzip --no-bytecode --public ."