Skip to content

Commit

Permalink
Add model names
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed May 20, 2024
1 parent 275e4ff commit 97cf05e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tiktoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ var ModelPrefixToEncoding = map[string]string{
"gpt-4o-": O200kBase, // e.g., gpt-4o-2024-05-13
"gpt-4-": CL100kBase, // e.g., gpt-4-0314, etc., plus gpt-4-32k
"gpt-3.5-turbo-": CL100kBase, // e.g, gpt-3.5-turbo-0301, -0401, etc.
"gpt-3.5": CL100kBase, // Common shorthand
"gpt-35-turbo": CL100kBase, // Azure deployment name

// fine-tuned
"ft:gpt-4": CL100kBase,
"ft:gpt-3.5-turbo": CL100kBase,
"ft:davinci-002": CL100kBase,
"ft:babbage-002": CL100kBase,
}

// ModelToEncoding maps models to encodings.
Expand Down Expand Up @@ -70,7 +77,8 @@ var ModelToEncoding = map[string]string{
"code-search-babbage-code-001": R50kBase,
"code-search-ada-code-001": R50kBase,
// open source
"gpt2": GPT2,
"gpt2": GPT2,
"gpt-2": GPT2, // Maintains consistency with gpt-4
}

// NewEncodingForModel returns a new Encoding based on the given model.
Expand Down

0 comments on commit 97cf05e

Please sign in to comment.