Skip to content

Commit

Permalink
Merge pull request #97 from akynau/add-gpt-4-turbo
Browse files Browse the repository at this point in the history
Add GPT-4 Turbo
  • Loading branch information
dqbd authored Apr 12, 2024
2 parents 110eef4 + 3768231 commit 1d8a762
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ export function getEncodingNameForModel(model: TiktokenModel) {
case "gpt-4-1106-preview":
case "gpt-4-vision-preview":
case "gpt-3.5-turbo-0125":
case "gpt-4-turbo":
case "gpt-4-turbo-2024-04-09":
case "gpt-4-turbo-preview":
case "gpt-4-0125-preview":
case "text-embedding-ada-002": {
Expand Down
2 changes: 2 additions & 0 deletions tiktoken/model_to_encoding.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"gpt-4-32k": "cl100k_base",
"gpt-4-32k-0314": "cl100k_base",
"gpt-4-32k-0613": "cl100k_base",
"gpt-4-turbo": "cl100k_base",
"gpt-4-turbo-2024-04-09": "cl100k_base",
"gpt-4-turbo-preview": "cl100k_base",
"gpt-4-1106-preview": "cl100k_base",
"gpt-4-0125-preview": "cl100k_base",
Expand Down
4 changes: 4 additions & 0 deletions wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ export type TiktokenModel =
| "gpt-4-32k"
| "gpt-4-32k-0314"
| "gpt-4-32k-0613"
| "gpt-4-turbo"
| "gpt-4-turbo-2024-04-09"
| "gpt-4-turbo-preview"
| "gpt-4-1106-preview"
| "gpt-4-0125-preview"
Expand Down Expand Up @@ -468,6 +470,8 @@ pub fn encoding_for_model(
"gpt-4-1106-preview" => Ok("cl100k_base"),
"gpt-4-vision-preview" => Ok("cl100k_base"),
"gpt-3.5-turbo-0125" => Ok("cl100k_base"),
"gpt-4-turbo" => Ok("cl100k_base"),
"gpt-4-turbo-2024-04-09" => Ok("cl100k_base"),
"gpt-4-turbo-preview" => Ok("cl100k_base"),
"gpt-4-0125-preview" => Ok("cl100k_base"),
model => Err(JsError::new(
Expand Down

0 comments on commit 1d8a762

Please sign in to comment.