Skip to content

Commit aa8a428

Browse files
committed
Fix ruff
1 parent 721e1af commit aa8a428

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • python/packages/lab/gaia/agent_framework_lab_gaia

python/packages/lab/gaia/agent_framework_lab_gaia/gaia.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def is_float(x: Any) -> bool:
186186

187187
if is_float(ground_truth):
188188
# numeric exact match after normalization
189-
return _normalize_number_str(model_answer) == float(ground_truth)
189+
return abs(_normalize_number_str(model_answer) - float(ground_truth)) < 1e-6
190190
if any(ch in ground_truth for ch in [",", ";"]):
191191
# list with per-element compare (number or string)
192192
gt_elems = _split_string(ground_truth)
@@ -196,7 +196,7 @@ def is_float(x: Any) -> bool:
196196
comparisons = []
197197
for ma, gt in zip(ma_elems, gt_elems, strict=False):
198198
if is_float(gt):
199-
comparisons.append(_normalize_number_str(ma) == float(gt))
199+
comparisons.append(abs(_normalize_number_str(ma) - float(gt)) < 1e-6)
200200
else:
201201
comparisons.append(_normalize_str(ma, remove_punct=False) == _normalize_str(gt, remove_punct=False))
202202
return all(comparisons)

0 commit comments

Comments
 (0)