Skip to content

Commit

Permalink
add other gpt versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Jul 1, 2023
1 parent a9c3f38 commit 1f739e9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/src/core/chat/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export async function createStreamingChatCompletion(messages: OpenAIMessage[], p
}

export const maxTokensByModel = {
"chatgpt-3.5-turbo": 2048,
"gpt-3.5-turbo": 4096,
"gpt-4": 8192,
}
"gpt-4-0613": 8192,
"gpt-4-32k": 32768,
"gpt-4-32k-0613": 32768,
"gpt-3.5-turbo-16k": 16384,
"gpt-3.5-turbo-0613": 4096,
"gpt-3.5-turbo-16k-0613": 16384,
};
30 changes: 28 additions & 2 deletions app/src/global-options/parameters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export const parameterOptions: OptionGroup = {
renderProps: (value, options, context) => ({
type: "select",
label: "Model",
description: value === 'gpt-4' && context.intl.formatMessage(
description: value?.includes('gpt-4') && context.intl.formatMessage(
{
defaultMessage: "Note: GPT-4 will only work if your OpenAI account has been granted access to the new model. <a>Request access here.</a>",
defaultMessage: "Note: This model will only work if your OpenAI account has been granted you have been given access to it. <a>Request access here.</a>",
},
{
a: (text: string) => <a href="https://openai.com/waitlist/gpt-4-api" target="_blank" rel="noreferer">{text}</a>
Expand All @@ -32,10 +32,36 @@ export const parameterOptions: OptionGroup = {
label: "GPT 3.5 Turbo (default)",
value: "gpt-3.5-turbo",
},
{
label: "GPT 3.5 Turbo 16k",
value: "gpt-3.5-turbo-16k",
},
{
label: "GPT 4 (requires invite)",
value: "gpt-4",
},
{
label: "GPT 4 32k (requires invite)",
value: "gpt-4-32k",
},
{
label: "GPT 4 Snapshot (June 13, 2023)",
value: "gpt-4-0613",
},

{
label: "GPT 4 32k Snapshot (June 13, 2023)",
value: "gpt-4-32k-0613",
},

{
label: "GPT 3.5 Turbo Snapshot (June 13, 2023)",
value: "gpt-3.5-turbo-0613",
},
{
label: "GPT 3.5 Turbo 16k Snapshot (June 13, 2023)",
value: "gpt-3.5-turbo-16k-0613",
},
],
}),
},
Expand Down

0 comments on commit 1f739e9

Please sign in to comment.