We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cbd5da8 + ff5f548 commit 957c550Copy full SHA for 957c550
aiopslab/orchestrator/evaluators/quantitative.py
@@ -34,8 +34,16 @@ def in_tokens(trace: list[SessionItem]) -> int:
34
35
36
def is_exact_match(pred: int | str | list, target: int | str | list) -> bool:
37
- """Return True if the prediction is an exact match to the target."""
38
- return pred == target
+ """Return True if the prediction is an exact match to the target.
+ Also considers ["x"] and "x" as equivalent.
39
+ """
40
+ # Normalize both sides to lists for consistent comparison
41
+ def normalize(value: int | str | list) -> list:
42
+ if isinstance(value, list):
43
+ return value
44
+ return [value]
45
+
46
+ return normalize(pred) == normalize(target)
47
48
49
def is_exact_match_lower(pred: str, target: str) -> bool:
0 commit comments