Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 11, 2024
1 parent faecd08 commit a2e085c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ice/agents/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _extract_completion(self, response: dict) -> str:
def _extract_prediction(self, response: dict) -> dict[str, float]:
"""Extract the prediction dictionary from the completion response."""
answer = response["choices"][0]["logprobs"]["content"][0]["top_logprobs"]
return {a['token']: math.exp(a['logprob']) for a in answer}
return {a["token"]: math.exp(a["logprob"]) for a in answer}

def _compute_relative_probs(
self, choices: tuple[str, ...], choice_prefix: str, prediction: dict[str, float]
Expand Down

0 comments on commit a2e085c

Please sign in to comment.