MCPcopy Create free account
hub / github.com/InternScience/SciReason / floatify

Function floatify

opencompass/datasets/TheoremQA/number_utils.py:7–15  ·  view source on GitHub ↗
(num: str)

Source from the content-addressed store, hash-verified

5
6
7def floatify(num: str):
8 try:
9 num = float(num)
10 if num.is_integer():
11 return round(num)
12 else:
13 return num
14 except Exception:
15 return None
16
17
18def within_eps(pred: float, gt: float):

Callers 1

number_itFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected