Upload verification_service.py with huggingface_hub
Browse files- verification_service.py +5 -1
verification_service.py
CHANGED
|
@@ -52,7 +52,11 @@ def check_logical_progression(step_n: str, step_n_plus_1: str) -> bool:
|
|
| 52 |
lhs2, rhs2 = eq2.split('=', 1)
|
| 53 |
|
| 54 |
if MATH_VERIFY_AVAILABLE:
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
return True
|
| 57 |
else:
|
| 58 |
expr1 = parse_expr(lhs1.replace('^', '**')) - parse_expr(rhs1.replace('^', '**'))
|
|
|
|
| 52 |
lhs2, rhs2 = eq2.split('=', 1)
|
| 53 |
|
| 54 |
if MATH_VERIFY_AVAILABLE:
|
| 55 |
+
try:
|
| 56 |
+
matched = verify(parse(eq1), parse(eq2))
|
| 57 |
+
except (ValueError, Exception):
|
| 58 |
+
matched = (eq1.strip() == eq2.strip())
|
| 59 |
+
if matched:
|
| 60 |
return True
|
| 61 |
else:
|
| 62 |
expr1 = parse_expr(lhs1.replace('^', '**')) - parse_expr(rhs1.replace('^', '**'))
|