Spaces:
Running
Running
fix math
Browse files
utils.py
CHANGED
@@ -288,9 +288,10 @@ def strip_string(string):
|
|
288 |
|
289 |
# NOTE: X/Y changed to \frac{X}{Y} in dataset, but in simple cases fix in case the model output is X/Y
|
290 |
# string = fix_a_slash_b(string)
|
291 |
-
if string.startswith("\\boxed{") and string.endswith("}"):
|
292 |
-
string = string[7:-1]
|
293 |
string = string.split("=")[-1]
|
|
|
|
|
|
|
294 |
return string
|
295 |
|
296 |
|
|
|
288 |
|
289 |
# NOTE: X/Y changed to \frac{X}{Y} in dataset, but in simple cases fix in case the model output is X/Y
|
290 |
# string = fix_a_slash_b(string)
|
|
|
|
|
291 |
string = string.split("=")[-1]
|
292 |
+
while string.startswith("\\boxed{") and string.endswith("}"):
|
293 |
+
string = string[7:-1]
|
294 |
+
string = string.split("=")[-1]
|
295 |
return string
|
296 |
|
297 |
|