Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -580,14 +580,13 @@ STRICT REQUIREMENTS:
|
|
580 |
sympy_output = extract_and_run_sympy_code_simple(response_text)
|
581 |
|
582 |
if sympy_output:
|
583 |
-
# Check if SymPy ran successfully
|
584 |
if "Error" not in sympy_output:
|
585 |
-
resolution_text, has_discrepancy, revised_solution = check_and_resolve_discrepancy(response_text, sympy_output)
|
586 |
response_text = f"{response_text}\n\nSymPy Verification Results:\n```\n{sympy_output}\n```\n\nVerification Analysis:\n{resolution_text}"
|
587 |
|
588 |
if has_discrepancy and revised_solution:
|
589 |
logger.debug("Performing final verification for problem with discrepancy")
|
590 |
-
final_verification = perform_final_verification(revised_solution,sympy_correct)
|
591 |
response_text += "\n\nFinal Expert Verification:\n" + final_verification
|
592 |
|
593 |
# Create LaTeX content
|
@@ -668,7 +667,8 @@ def check_and_resolve_discrepancy(initial_response, sympy_output):
|
|
668 |
has_discrepancy = False #Initialize
|
669 |
resolution_text = ""
|
670 |
revised_solution = None
|
671 |
-
|
|
|
672 |
try:
|
673 |
resolution_prompt = f"""Here is a mathematics question with two answers.
|
674 |
The first, called Original solution, is a complete solution.
|
|
|
580 |
sympy_output = extract_and_run_sympy_code_simple(response_text)
|
581 |
|
582 |
if sympy_output:
|
|
|
583 |
if "Error" not in sympy_output:
|
584 |
+
resolution_text, has_discrepancy, revised_solution, sympy_correct = check_and_resolve_discrepancy(response_text, sympy_output)
|
585 |
response_text = f"{response_text}\n\nSymPy Verification Results:\n```\n{sympy_output}\n```\n\nVerification Analysis:\n{resolution_text}"
|
586 |
|
587 |
if has_discrepancy and revised_solution:
|
588 |
logger.debug("Performing final verification for problem with discrepancy")
|
589 |
+
final_verification = perform_final_verification(revised_solution, sympy_correct)
|
590 |
response_text += "\n\nFinal Expert Verification:\n" + final_verification
|
591 |
|
592 |
# Create LaTeX content
|
|
|
667 |
has_discrepancy = False #Initialize
|
668 |
resolution_text = ""
|
669 |
revised_solution = None
|
670 |
+
sympy_correct = None # Initialize at the start
|
671 |
+
|
672 |
try:
|
673 |
resolution_prompt = f"""Here is a mathematics question with two answers.
|
674 |
The first, called Original solution, is a complete solution.
|