[CI/Build] Replace math.isclose with pytest.approx (#18703)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-05-26 17:05:17 +08:00
committed by GitHub
parent 61a45e7a72
commit 38b13dfe78
6 changed files with 22 additions and 31 deletions

View File

@@ -1,5 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
import math
from collections.abc import Sequence
import mteb
@@ -115,4 +114,4 @@ def mteb_test_embed_models(hf_runner,
print("SentenceTransformer:", model_dtype, st_main_score)
print("Difference:", st_main_score - vllm_main_score)
assert math.isclose(st_main_score, vllm_main_score, rel_tol=MTEB_EMBED_TOL)
assert st_main_score == pytest.approx(vllm_main_score, rel=MTEB_EMBED_TOL)