Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GPT-3.5 Turbo models specifications #747

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ConversationSpec :
}

""""
| GPT_3_5_TURBO model has 4097 max context length
| GPT_3_5_TURBO model has 16385 max context length
| when the number of token in the conversation is greater than
| the space allotted for the message history in the prompt configuration
| the number of messages in the request must have fewer messages than
Expand Down Expand Up @@ -83,7 +83,7 @@ class ConversationSpec :
val memories = vectorStore.memories(model, conversationId, totalTokens)

// The messages in the request doesn't contain the message response
val messagesSizePlusMessageResponse = lastRequest.messages.size + 1
val messagesSizePlusMessageResponse = lastRequest.messages.size

messagesSizePlusMessageResponse shouldBeLessThan memories.size
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ sealed class ModelType(
val DEFAULT_SPLITTER_MODEL = GPT_3_5_TURBO
val functionSpecific: List<ModelType> = listOf(
GPT_3_5_TURBO_0613,
GPT_3_5_TURBO_0125,
GPT_3_5_16K_0613_TURBO_FUNCTIONS,
GPT_4_32K_0314_FUNCTIONS,
GPT_4_0613,
Expand All @@ -48,6 +49,7 @@ sealed class ModelType(
GPT_3_5_TURBO,
GPT_3_5_TURBO_0301,
GPT_3_5_TURBO_0613,
GPT_3_5_TURBO_0125,
GPT_3_5_TURBO_FUNCTIONS,
GPT_3_5_TURBO_16_K,
GPT_3_5_TURBO_16_K_1106,
Expand Down Expand Up @@ -100,11 +102,16 @@ sealed class ModelType(
) : ModelType(name, encodingType, maxContextLength)

object GPT_3_5_TURBO :
ModelType("gpt-3.5-turbo", CL100K_BASE, 4097, tokensPerMessage = 4, tokensPerName = 0, tokenPadding = 5)
ModelType("gpt-3.5-turbo", CL100K_BASE, 16385, tokensPerMessage = 4, tokensPerName = 0, tokenPadding = 5)

object GPT_3_5_TURBO_0125 :
ModelType("gpt-3.5-turbo-0125", CL100K_BASE, 16385, tokensPerMessage = 4, tokensPerName = 0, tokenPadding = 5)

@Deprecated("Use GPT_3_5_TURBO_0125 instead")
object GPT_3_5_TURBO_0301 :
ModelType("gpt-3.5-turbo-0301", CL100K_BASE, 4097, tokensPerMessage = 4, tokensPerName = 0, tokenPadding = 5)

@Deprecated("Use GPT_3_5_TURBO_0125 instead")
object GPT_3_5_TURBO_0613 :
ModelType("gpt-3.5-turbo-0613", CL100K_BASE, 4097, tokensPerMessage = 3, tokensPerName = 2, tokenPadding = 5)

Expand Down
Loading