compressionawareintelligence commited on
Commit
4324cef
·
verified ·
1 Parent(s): 11a296d

4.0.1: score stated values exactly (no truncation)

Browse files
Files changed (1) hide show
  1. caibench_dynamics.py +4 -1
caibench_dynamics.py CHANGED
@@ -835,7 +835,10 @@ VALUE_RE = re.compile(r"VALUE\s*:\s*\**\s*\$?(-?\d+(?:\.\d+)?)", re.IGNORECASE)
835
  def parse(text, fmt):
836
  if fmt == "value":
837
  m = VALUE_RE.findall(text or "")
838
- return str(int(float(m[-1]))) if m else None
 
 
 
839
  m = DECISION_RE.findall(text or "")
840
  if not m:
841
  return None
 
835
  def parse(text, fmt):
836
  if fmt == "value":
837
  m = VALUE_RE.findall(text or "")
838
+ if not m:
839
+ return None
840
+ v = float(m[-1])
841
+ return str(int(v)) if v.is_integer() else str(v)
842
  m = DECISION_RE.findall(text or "")
843
  if not m:
844
  return None