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

Function fix_sqrt

light-eval/src/eval_utils/math_util.py:148–160  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

146 return string
147
148def fix_sqrt(string):
149 if "\\sqrt" not in string:
150 return string
151 splits = string.split("\\sqrt")
152 new_string = splits[0]
153 for split in splits[1:]:
154 if split[0] != "{":
155 a = split[0]
156 new_substr = "\\sqrt{" + a + "}" + split[1:]
157 else:
158 new_substr = "\\sqrt" + split
159 new_string += new_substr
160 return new_string
161
162
163def strip_string(string):

Callers 1

strip_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected