From 4f9cbe5a5df74341d43b312950335a16712b2f9f Mon Sep 17 00:00:00 2001 From: Kaiser Squid E46 Date: Fri, 21 Apr 2023 23:11:35 +0800 Subject: [PATCH] Add GPT4 32K option --- public/index.html | 1 + public/scripts/openai.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/public/index.html b/public/index.html index a875e4ede..929940cfd 100644 --- a/public/index.html +++ b/public/index.html @@ -115,6 +115,7 @@ + diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 56c2f2a3a..0969e2228 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -55,6 +55,7 @@ const default_impersonation_prompt = "[Write your next reply from the point of v const gpt3_max = 4095; const gpt4_max = 8191; +const gpt4_32k_max = 32767; const tokenCache = {}; @@ -772,6 +773,9 @@ $(document).ready(function () { if (value == 'gpt-4') { $('#openai_max_context').attr('max', gpt4_max); } + else if (value == 'gpt-4-32k') { + $('#openai_max_context').attr('max', gpt4_32k_max); + } else { $('#openai_max_context').attr('max', gpt3_max); oai_settings.openai_max_context = Math.max(oai_settings.openai_max_context, gpt3_max);