Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -146,4 +146,41 @@ def generate_test(subject):
|
|
| 146 |
except Exception as e:
|
| 147 |
return f"Error: {str(e)}"
|
| 148 |
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
except Exception as e:
|
| 147 |
return f"Error: {str(e)}"
|
| 148 |
|
| 149 |
+
subjects = [
|
| 150 |
+
"Single Variable Calculus",
|
| 151 |
+
"Multivariable Calculus",
|
| 152 |
+
"Linear Algebra",
|
| 153 |
+
"Differential Equations",
|
| 154 |
+
"Real Analysis",
|
| 155 |
+
"Complex Analysis",
|
| 156 |
+
"Abstract Algebra",
|
| 157 |
+
"Probability Theory",
|
| 158 |
+
"Numerical Analysis",
|
| 159 |
+
"Topology"
|
| 160 |
+
]
|
| 161 |
+
|
| 162 |
+
# Create Gradio interface
|
| 163 |
+
interface = gr.Interface(
|
| 164 |
+
fn=generate_test,
|
| 165 |
+
inputs=gr.Dropdown(
|
| 166 |
+
choices=subjects,
|
| 167 |
+
label="Select Mathematics Subject",
|
| 168 |
+
info="Choose a subject for the exam questions"
|
| 169 |
+
),
|
| 170 |
+
outputs=gr.Markdown(
|
| 171 |
+
label="Generated Test",
|
| 172 |
+
latex_delimiters=[
|
| 173 |
+
{"left": "$$", "right": "$$", "display": True},
|
| 174 |
+
{"left": "$", "right": "$", "display": False}
|
| 175 |
+
]
|
| 176 |
+
),
|
| 177 |
+
title="Advanced Mathematics Test Generator",
|
| 178 |
+
description="""Generates university-level mathematics exam questions with solutions using Claude 3 Opus.
|
| 179 |
+
Limited to 25 requests per day. Please use responsibly.""",
|
| 180 |
+
theme="default",
|
| 181 |
+
allow_flagging="never"
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
# Launch the interface
|
| 185 |
+
if __name__ == "__main__":
|
| 186 |
+
interface.launch()
|