Skip to content

Commit 6750837

Browse files
committed
chore: adds encoding for new models
1 parent 45dd652 commit 6750837

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

examples/How_to_count_tokens_with_tiktoken.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"\n",
2121
"`tiktoken` supports three encodings used by OpenAI models:\n",
2222
"\n",
23-
"| Encoding name | OpenAI models |\n",
24-
"|-------------------------|-----------------------------------------------------|\n",
25-
"| `o200k_base` | `gpt-4o`, `gpt-4o-mini` |\n",
26-
"| `cl100k_base` | `gpt-4-turbo`, `gpt-4`, `gpt-3.5-turbo`, `text-embedding-ada-002`, `text-embedding-3-small`, `text-embedding-3-large` |\n",
27-
"| `p50k_base` | Codex models, `text-davinci-002`, `text-davinci-003`|\n",
28-
"| `r50k_base` (or `gpt2`) | GPT-3 models like `davinci` |\n",
23+
"| Encoding name | OpenAI models |\n",
24+
"|-------------------------|-----------------------------------------------------------------------------------------------------------------------|\n",
25+
"| `o200k_base` | `gpt-4o`, `gpt-4o-mini`, `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4.5-preview`, `gpt-4.5` |\n",
26+
"| `cl100k_base` | `gpt-4-turbo`, `gpt-4`, `gpt-3.5-turbo`, `text-embedding-ada-002`, `text-embedding-3-small`, `text-embedding-3-large` |\n",
27+
"| `p50k_base` | Codex models, `text-davinci-002`, `text-davinci-003` |\n",
28+
"| `r50k_base` (or `gpt2`) | GPT-3 models like `davinci` |\n",
2929
"\n",
3030
"You can retrieve the encoding for a model using `tiktoken.encoding_for_model()` as follows:\n",
3131
"```python\n",
@@ -80,12 +80,12 @@
8080
"output_type": "stream",
8181
"text": [
8282
"\n",
83-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.2\u001b[0m\n",
84-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
83+
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m24.0\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m24.2\u001B[0m\n",
84+
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\n",
8585
"Note: you may need to restart the kernel to use updated packages.\n",
8686
"\n",
87-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.2\u001b[0m\n",
88-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
87+
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m24.0\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m24.2\u001B[0m\n",
88+
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\n",
8989
"Note: you may need to restart the kernel to use updated packages.\n"
9090
]
9191
}

0 commit comments

Comments
 (0)