Skip to content

Commit

Permalink
Update token_count_utils.py (microsoft#2531)
Browse files Browse the repository at this point in the history
* Update token_count_utils.py

Update the token counts of new gpt models

ref: https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4

* format code with pre-commit

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 30, 2024
1 parent ba9ff45 commit bcb6117
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autogen/token_count_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ def get_max_token_limit(model: str = "gpt-3.5-turbo-0613") -> int:
model = re.sub(r"^gpt4", "gpt-4", model)

max_token_limit = {
"gpt-3.5-turbo": 4096,
"gpt-3.5-turbo": 16385,
"gpt-3.5-turbo-0125": 16385,
"gpt-3.5-turbo-0301": 4096,
"gpt-3.5-turbo-0613": 4096,
"gpt-3.5-turbo-instruct": 4096,
"gpt-3.5-turbo-16k": 16385,
"gpt-3.5-turbo-16k-0613": 16385,
"gpt-3.5-turbo-1106": 16385,
"gpt-4": 8192,
"gpt-4-turbo": 128000,
"gpt-4-turbo-2024-04-09": 128000,
"gpt-4-32k": 32768,
"gpt-4-32k-0314": 32768, # deprecate in Sep
"gpt-4-0314": 8192, # deprecate in Sep
Expand Down

0 comments on commit bcb6117

Please sign in to comment.