Skip to content

Commit

Permalink
[BUG] non chat openai models
Browse files Browse the repository at this point in the history
  • Loading branch information
YannDubs committed Nov 24, 2023
1 parent bac7e0e commit dd5ac0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/alpaca_eval/decoders/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def _openai_completion_helper(
else:
completion_batch = client.completions.create(prompt=prompt_batch, **curr_kwargs)
choices = completion_batch.choices
for i, choice in enumerate(choices):
choices[i] = choice.model_dump()

for choice in choices:
choice["total_tokens"] = completion_batch.usage.total_tokens / len(prompt_batch)
Expand Down

0 comments on commit dd5ac0b

Please sign in to comment.