Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -514,7 +514,6 @@ def generate_question(subject, difficulty, question_type):
|
|
| 514 |
|
| 515 |
system_prompt = f"""You are an expert mathematics professor creating a {difficulty_params['description']} exam question.
|
| 516 |
STRICT REQUIREMENTS:
|
| 517 |
-
0. Start out with a heading in bold: Question
|
| 518 |
1. Write exactly 1 {question_type} question on {subject} covering {selected_topic}.
|
| 519 |
2. Difficulty Level Guidelines:
|
| 520 |
{difficulty_params['description'].upper()}
|
|
@@ -531,7 +530,6 @@ STRICT REQUIREMENTS:
|
|
| 531 |
- Put each solution step on its own line in $$ $$
|
| 532 |
- DO NOT use \\begin{{aligned}} or similar environments
|
| 533 |
5. Include a detailed solution
|
| 534 |
-
- Begin the solution with a heading in bold: Original Solution
|
| 535 |
- If the question involves geometry make sure to identify any general geometric formulas that apply, For example:
|
| 536 |
* Areas/volumes of common shapes and solids
|
| 537 |
* Cross-sectional areas of geometric figures
|
|
@@ -541,7 +539,6 @@ STRICT REQUIREMENTS:
|
|
| 541 |
* ensure integration bounds align with the physical direction of the process being modeled
|
| 542 |
6. Maintain clear formatting
|
| 543 |
7. At the end of the solution output, print SymPy code that you would use to solve or verify the main equations in the question
|
| 544 |
-
and give this section a heading in bold: SymPy Verification
|
| 545 |
8. Observe the folloiwng SymPy Guidelines
|
| 546 |
{SYMPY_GUIDELINES}"""
|
| 547 |
|
|
@@ -669,8 +666,6 @@ def check_and_resolve_discrepancy(initial_response, sympy_output):
|
|
| 669 |
resolution_prompt = f"""Here is a mathematics question with two answers.
|
| 670 |
The first, called Original solution, is a complete solution.
|
| 671 |
The second, called SymPy Verification, will only provide the final answer.
|
| 672 |
-
|
| 673 |
-
Begin this section with a heading in bold: Comparison of SymPy Verifiation with Original Solution
|
| 674 |
|
| 675 |
If the SymPy Verification answer is consistent with the final answer Original solution,
|
| 676 |
then please say that they are consistent and briefly explain why.
|
|
@@ -681,7 +676,7 @@ def check_and_resolve_discrepancy(initial_response, sympy_output):
|
|
| 681 |
3. Write "Here is the revised complete solution:" and then write out the ENTIRE solution from beginning
|
| 682 |
to end, including all parts that were correct and the corrections for any incorrect parts.
|
| 683 |
Do not refer to the original solution or say things like "the rest remains the same" - write
|
| 684 |
-
out everything in full.
|
| 685 |
|
| 686 |
Original solution:
|
| 687 |
{initial_response}
|
|
@@ -780,8 +775,6 @@ Revised Solution to Verify:
|
|
| 780 |
|
| 781 |
Please follow these steps exactly:
|
| 782 |
|
| 783 |
-
0. Begin with a heading in bold: Expert Analysis of Revised Solution
|
| 784 |
-
|
| 785 |
1. First, analyze the solution for:
|
| 786 |
- Mathematical correctness
|
| 787 |
- Missing cases or assumptions
|
|
@@ -789,8 +782,7 @@ Please follow these steps exactly:
|
|
| 789 |
- Necessary conditions and edge cases
|
| 790 |
- Any subtle errors or oversights
|
| 791 |
|
| 792 |
-
2.
|
| 793 |
-
Then write exactly this phrase:
|
| 794 |
"Here is the complete verified solution:"
|
| 795 |
|
| 796 |
3. Then write out the ENTIRE solution from beginning to end, including:
|
|
|
|
| 514 |
|
| 515 |
system_prompt = f"""You are an expert mathematics professor creating a {difficulty_params['description']} exam question.
|
| 516 |
STRICT REQUIREMENTS:
|
|
|
|
| 517 |
1. Write exactly 1 {question_type} question on {subject} covering {selected_topic}.
|
| 518 |
2. Difficulty Level Guidelines:
|
| 519 |
{difficulty_params['description'].upper()}
|
|
|
|
| 530 |
- Put each solution step on its own line in $$ $$
|
| 531 |
- DO NOT use \\begin{{aligned}} or similar environments
|
| 532 |
5. Include a detailed solution
|
|
|
|
| 533 |
- If the question involves geometry make sure to identify any general geometric formulas that apply, For example:
|
| 534 |
* Areas/volumes of common shapes and solids
|
| 535 |
* Cross-sectional areas of geometric figures
|
|
|
|
| 539 |
* ensure integration bounds align with the physical direction of the process being modeled
|
| 540 |
6. Maintain clear formatting
|
| 541 |
7. At the end of the solution output, print SymPy code that you would use to solve or verify the main equations in the question
|
|
|
|
| 542 |
8. Observe the folloiwng SymPy Guidelines
|
| 543 |
{SYMPY_GUIDELINES}"""
|
| 544 |
|
|
|
|
| 666 |
resolution_prompt = f"""Here is a mathematics question with two answers.
|
| 667 |
The first, called Original solution, is a complete solution.
|
| 668 |
The second, called SymPy Verification, will only provide the final answer.
|
|
|
|
|
|
|
| 669 |
|
| 670 |
If the SymPy Verification answer is consistent with the final answer Original solution,
|
| 671 |
then please say that they are consistent and briefly explain why.
|
|
|
|
| 676 |
3. Write "Here is the revised complete solution:" and then write out the ENTIRE solution from beginning
|
| 677 |
to end, including all parts that were correct and the corrections for any incorrect parts.
|
| 678 |
Do not refer to the original solution or say things like "the rest remains the same" - write
|
| 679 |
+
out everything in full.
|
| 680 |
|
| 681 |
Original solution:
|
| 682 |
{initial_response}
|
|
|
|
| 775 |
|
| 776 |
Please follow these steps exactly:
|
| 777 |
|
|
|
|
|
|
|
| 778 |
1. First, analyze the solution for:
|
| 779 |
- Mathematical correctness
|
| 780 |
- Missing cases or assumptions
|
|
|
|
| 782 |
- Necessary conditions and edge cases
|
| 783 |
- Any subtle errors or oversights
|
| 784 |
|
| 785 |
+
2. Write exactly this phrase to begin your analysis:
|
|
|
|
| 786 |
"Here is the complete verified solution:"
|
| 787 |
|
| 788 |
3. Then write out the ENTIRE solution from beginning to end, including:
|