Skip to content

Commit

Permalink
Hanlding avgLogprobs infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
Plytas committed Jan 10, 2025
1 parent fd77c6b commit 17f2ef5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Data/Candidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public static function from(array $attributes): self
default => null,
};

if (($attributes['avgLogprobs'] ?? null) === 'Infinity') { // @phpstan-ignore-line
$attributes['avgLogprobs'] = INF;
}

return new self(
content: $content,
finishReason: $finishReason,
Expand Down

0 comments on commit 17f2ef5

Please sign in to comment.