Skip to content

Commit

Permalink
add chat assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
baberabb committed Oct 30, 2024
1 parent c151945 commit bc6a58f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lm_eval/models/openai_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def _create_payload(
seed=1234,
**kwargs,
) -> dict:
assert (
type(messages) is not str
), "chat-completions require the --apply_chat_template flag."
gen_kwargs.pop("do_sample", False)
if "max_tokens" in gen_kwargs:
max_tokens = gen_kwargs.pop("max_tokens")
Expand Down Expand Up @@ -247,6 +250,9 @@ def _create_payload(
seed=1234,
**kwargs,
) -> dict:
assert (
type(messages) is not str
), "chat-completions require the --apply_chat_template flag."
gen_kwargs.pop("do_sample", False)
if "max_tokens" in gen_kwargs:
max_tokens = gen_kwargs.pop("max_tokens")
Expand Down

0 comments on commit bc6a58f

Please sign in to comment.