Varshithdharmajv commited on
Commit
71e6f1d
·
verified ·
1 Parent(s): 5e2e7ba

Upload consensus_fusion.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. consensus_fusion.py +6 -1
consensus_fusion.py CHANGED
@@ -101,7 +101,12 @@ def normalize_answers(answers: List[str]) -> Dict[str, List[int]]:
101
  key_clean = _normalize_answer(key)
102
 
103
  if MATH_VERIFY_AVAILABLE:
104
- if verify(clean, key_clean, parsing_timeout=None):
 
 
 
 
 
105
  normalized_groups[key].append(idx)
106
  matched = True
107
  break
 
101
  key_clean = _normalize_answer(key)
102
 
103
  if MATH_VERIFY_AVAILABLE:
104
+ try:
105
+ match = verify(clean, key_clean)
106
+ except (ValueError, Exception):
107
+ # Fallback when math_verify fails in threaded env (signal.alarm restriction)
108
+ match = (str(clean) == str(key_clean))
109
+ if match:
110
  normalized_groups[key].append(idx)
111
  matched = True
112
  break