Fix the condition.

This commit is contained in:
Nicolas Patry 2024-08-16 13:20:53 +02:00
parent 188ceb2fef
commit 986071197b
No known key found for this signature in database
GPG Key ID: 64AF4752B2967863

View File

@ -118,8 +118,7 @@ class ResponseComparator(JSONSnapshotExtension):
and token.text == other.text and token.text == other.text
and ( and (
self.ignore_logprob self.ignore_logprob
or token.logprob == other.logprob or (token.logprob == other.logprob and token.logprob is None)
and token.logprob is None
or math.isclose(token.logprob, other.logprob, rel_tol=self.rtol) or math.isclose(token.logprob, other.logprob, rel_tol=self.rtol)
) )
and token.special == other.special and token.special == other.special