Merge pull request #129 from TheUnawsomeGuy/main

Add GPT4 32K option
This commit is contained in:
Cohee
2023-04-21 18:19:47 +03:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,7 @@
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option> <option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
<option value="gpt-3.5-turbo-0301">gpt-3.5-turbo-0301</option> <option value="gpt-3.5-turbo-0301">gpt-3.5-turbo-0301</option>
<option value="gpt-4">gpt-4</option> <option value="gpt-4">gpt-4</option>
<option value="gpt-4-32k">gpt-4-32k</option>
</select> </select>
</div> </div>
</div> </div>

View File

@ -55,6 +55,7 @@ const default_impersonation_prompt = "[Write your next reply from the point of v
const gpt3_max = 4095; const gpt3_max = 4095;
const gpt4_max = 8191; const gpt4_max = 8191;
const gpt4_32k_max = 32767;
const tokenCache = {}; const tokenCache = {};
@ -772,6 +773,9 @@ $(document).ready(function () {
if (value == 'gpt-4') { if (value == 'gpt-4') {
$('#openai_max_context').attr('max', gpt4_max); $('#openai_max_context').attr('max', gpt4_max);
} }
else if (value == 'gpt-4-32k') {
$('#openai_max_context').attr('max', gpt4_32k_max);
}
else { else {
$('#openai_max_context').attr('max', gpt3_max); $('#openai_max_context').attr('max', gpt3_max);
oai_settings.openai_max_context = Math.max(oai_settings.openai_max_context, gpt3_max); oai_settings.openai_max_context = Math.max(oai_settings.openai_max_context, gpt3_max);