MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / floatify

Function floatify

accessory/eval_mm/utils/math_utils.py:468–476  ·  view source on GitHub ↗
(num: str)

Source from the content-addressed store, hash-verified

466
467
468def floatify(num: str):
469 try:
470 num = float(num)
471 if num.is_integer():
472 return round(num)
473 else:
474 return num
475 except Exception:
476 return None
477
478
479def number_it(num: str):

Callers 1

number_itFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected