Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ if openai.api_key is None:
|
|
32 |
|
33 |
|
34 |
# Request tracking
|
35 |
-
MAX_REQUESTS_PER_DAY =
|
36 |
request_history = deque(maxlen=1000)
|
37 |
|
38 |
# Define subtopic mappings
|
@@ -129,11 +129,9 @@ SYMPY_GUIDELINES = """
|
|
129 |
When writing SymPy code to verify solutions:
|
130 |
|
131 |
Import Guidelines:
|
132 |
-
-
|
133 |
from sympy import Matrix, solve, Symbol, pi, cos, sin
|
134 |
-
-
|
135 |
-
import sympy as sp
|
136 |
-
But NEVER mix these import styles in the same code
|
137 |
|
138 |
NOTE: For eigenvalue problems, use 'lam = Symbol('lam')' instead of importing from sympy.abc
|
139 |
|
@@ -1273,8 +1271,10 @@ def update_subtopics(subject):
|
|
1273 |
# Create Gradio interface
|
1274 |
with gr.Blocks() as interface:
|
1275 |
gr.Markdown("# Advanced Mathematics Question Generator")
|
1276 |
-
gr.Markdown("""Generates
|
1277 |
-
|
|
|
|
|
1278 |
|
1279 |
with gr.Row():
|
1280 |
with gr.Column():
|
@@ -1318,7 +1318,7 @@ with gr.Blocks() as interface:
|
|
1318 |
# Add the new enhancement checkbox
|
1319 |
use_enhancement = gr.Radio(
|
1320 |
choices=["yes", "no"],
|
1321 |
-
label="Enhance with Textbook Material",
|
1322 |
info="Include relevant textbook examples to guide question generation",
|
1323 |
value="no"
|
1324 |
)
|
|
|
32 |
|
33 |
|
34 |
# Request tracking
|
35 |
+
MAX_REQUESTS_PER_DAY = 20
|
36 |
request_history = deque(maxlen=1000)
|
37 |
|
38 |
# Define subtopic mappings
|
|
|
129 |
When writing SymPy code to verify solutions:
|
130 |
|
131 |
Import Guidelines:
|
132 |
+
- ALWAYS import with "from sympy..." using specific imports like this:
|
133 |
from sympy import Matrix, solve, Symbol, pi, cos, sin
|
134 |
+
- DO NOT use full namespace import like this: import sympy as sp
|
|
|
|
|
135 |
|
136 |
NOTE: For eigenvalue problems, use 'lam = Symbol('lam')' instead of importing from sympy.abc
|
137 |
|
|
|
1271 |
# Create Gradio interface
|
1272 |
with gr.Blocks() as interface:
|
1273 |
gr.Markdown("# Advanced Mathematics Question Generator")
|
1274 |
+
gr.Markdown("""Generates 10 university-level mathematics questions using Claude 3.5 Sonnet.
|
1275 |
+
Solves the question of selected difficulty with Claude 3.5 Sonnet and SymPy verification.
|
1276 |
+
Final verification possible with ChatGPT o1-Preview toggle.
|
1277 |
+
Limited to 25 requests per day.""")
|
1278 |
|
1279 |
with gr.Row():
|
1280 |
with gr.Column():
|
|
|
1318 |
# Add the new enhancement checkbox
|
1319 |
use_enhancement = gr.Radio(
|
1320 |
choices=["yes", "no"],
|
1321 |
+
label="Enhance with Textbook Material if Real Analysis",
|
1322 |
info="Include relevant textbook examples to guide question generation",
|
1323 |
value="no"
|
1324 |
)
|