From 8f01b525f10fd5e661e2383ef8dcbf2d119c7a0c Mon Sep 17 00:00:00 2001 From: Baber Date: Wed, 25 Dec 2024 03:22:51 +0000 Subject: [PATCH] nit --- lm_eval/models/openai_completions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lm_eval/models/openai_completions.py b/lm_eval/models/openai_completions.py index 794ac4ab38..223fa236e9 100644 --- a/lm_eval/models/openai_completions.py +++ b/lm_eval/models/openai_completions.py @@ -70,7 +70,7 @@ def parse_logprobs( outputs = [outputs] for out in outputs: for choice, ctxlen in zip( - sorted(out["choices"], key=itemgetter("id")), ctxlens + sorted(out["choices"], key=itemgetter("index")), ctxlens ): assert ctxlen > 0, "Context length must be greater than 0" logprobs = sum(choice["logprobs"]["token_logprobs"][ctxlen:-1])