Skip to content

Commit 6054458

Browse files
committed
Added support for GPT-4o
1 parent 1a13a34 commit 6054458

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

evals/elsuite/track_the_stat/scripts/make_plots.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ def zero_if_none(input_num):
2626
"llama-2-70b-chat",
2727
"random_baseline",
2828
"human_baseline",
29+
"gpt-4o"
2930
]
3031
# separate list for OAI models for token counting, not supported in others.
3132
OAI_MODELS = [
3233
"gpt-4-0125-preview",
3334
"gpt-3.5-turbo-0125",
3435
"gpt-4-base",
36+
"gpt-4o"
3537
]
3638

3739
STAT_TO_LABEL = {
@@ -50,6 +52,8 @@ def get_model(spec):
5052
# this is hilariously ugly but it works for now (sorry)
5153
if "gpt-4-turbo-preview" in spec["completion_fns"][0]:
5254
return "gpt-4-0125-preview"
55+
if "gpt-4o" in spec["completion_fns"][0]:
56+
return "gpt-4o"
5357
elif "gpt-3.5-turbo" in spec["completion_fns"][0]:
5458
return "gpt-3.5-turbo-0125"
5559
elif "gpt-4-base" in spec["completion_fns"][0]:

evals/registry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def n_ctx_from_model_name(model_name: str) -> Optional[int]:
4242
("gpt-3.5-turbo-", 4096),
4343
("gpt-4-32k-", 32768),
4444
("gpt-4-", 8192),
45+
("gpt-4o", 128_000),
4546
]
4647
MODEL_NAME_TO_N_CTX: dict[str, int] = {
4748
"ada": 2048,
@@ -65,6 +66,7 @@ def n_ctx_from_model_name(model_name: str) -> Optional[int]:
6566
"gpt-4-1106-preview": 128_000,
6667
"gpt-4-turbo-preview": 128_000,
6768
"gpt-4-0125-preview": 128_000,
69+
"gpt-4o": 128_000
6870
}
6971

7072
# first, look for an exact match
@@ -84,7 +86,7 @@ def is_chat_model(model_name: str) -> bool:
8486
if model_name in {"gpt-4-base"} or model_name.startswith("gpt-3.5-turbo-instruct"):
8587
return False
8688

87-
CHAT_MODEL_NAMES = {"gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-32k"}
89+
CHAT_MODEL_NAMES = {"gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "gpt-4-32k", "gpt-4o"}
8890

8991
if model_name in CHAT_MODEL_NAMES:
9092
return True

0 commit comments

Comments
 (0)