From dd5ac0b064275a6f3b0e419182f8cf1b18fc7fb4 Mon Sep 17 00:00:00 2001 From: Yann Dubois Date: Fri, 24 Nov 2023 14:49:06 -0800 Subject: [PATCH] [BUG] non chat openai models --- src/alpaca_eval/decoders/openai.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alpaca_eval/decoders/openai.py b/src/alpaca_eval/decoders/openai.py index 35f37dd0..8a7981ec 100644 --- a/src/alpaca_eval/decoders/openai.py +++ b/src/alpaca_eval/decoders/openai.py @@ -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)