Skip to content

Commit

Permalink
Fix compatibility with llm-anyscale-endpoints, refs #401
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jan 26, 2024
1 parent 9119b03 commit 0f8ffbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llm/default_plugins/openai_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ def combine_chunks(chunks: List) -> dict:

for item in chunks:
for choice in item.choices:
if choice.logprobs:
if choice.logprobs and hasattr(choice.logprobs, "top_logprobs"):
logprobs.append(
{
"text": choice.text,
"text": choice.text if hasattr(choice, "text") else None,
"top_logprobs": choice.logprobs.top_logprobs,
}
)
Expand Down

0 comments on commit 0f8ffbf

Please sign in to comment.