From a3bc51bceac2752d44e8d7bc89c85569fa7098fe Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 3 Dec 2023 13:56:22 +0200 Subject: [PATCH 1/2] Fix type-in max context for OAI --- public/scripts/openai.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 98a2d1229..57b979f32 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -3238,6 +3238,8 @@ async function onModelChange() { $('#top_k_openai').attr('max', 200).val(oai_settings.top_k_openai).trigger('input'); } + $('#openai_max_context_counter').attr('max', Number($('#openai_max_context').attr('max'))); + saveSettingsDebounced(); eventSource.emit(event_types.CHATCOMPLETION_MODEL_CHANGED, value); } @@ -3546,6 +3548,7 @@ $(document).ready(async function () { oai_settings.use_ai21_tokenizer ? ai21_max = 8191 : ai21_max = 9200; oai_settings.openai_max_context = Math.min(ai21_max, oai_settings.openai_max_context); $('#openai_max_context').attr('max', ai21_max).val(oai_settings.openai_max_context).trigger('input'); + $('#openai_max_context_counter').attr('max', Number($('#openai_max_context').attr('max'))); saveSettingsDebounced(); }); From 5fb0807dcc0c2195a12dc4a78063b6109e4ce25a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 3 Dec 2023 14:02:38 +0200 Subject: [PATCH 2/2] Adjust max context step --- public/scripts/power-user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index acb6b5bb9..393d81908 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -49,7 +49,7 @@ export { export const MAX_CONTEXT_DEFAULT = 8192; const MAX_CONTEXT_UNLOCKED = 200 * 1000; -const unlockedMaxContextStep = 1024; +const unlockedMaxContextStep = 512; const maxContextMin = 512; const maxContextStep = 256;