FractalAIR commited on
Commit
cc8d8d3
·
verified ·
1 Parent(s): 584c430

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -91,9 +91,9 @@ def generate_response(user_message,
91
 
92
 
93
  example_messages = {
94
- "JEE Main 2025 Combinatorics": "From all the English alphabets, five letters are chosen and are arranged in alphabetical order. The total number of ways, in which the middle letter is 'M', is?",
95
- "JEE Main 2025 Coordinate Geometry": "A circle \\(C\\) of radius 2 lies in the second quadrant and touches both the coordinate axes. Let \\(r\\) be the radius of a circle that has centre at the point \\((2, 5)\\) and intersects the circle \\(C\\) at exactly two points. If the set of all possible values of \\(r\\) is the interval \\((\\alpha, \\beta)\\), then \\(3\\beta - 2\\alpha\\) is?",
96
- "JEE Main 2025 Probability & Statistics": "A coin is tossed three times. Let \(X\) denote the number of times a tail follows a head. If \\(\\mu\\) and \\(\\sigma^2\\) denote the mean and variance of \\(X\\), then the value of \\(64(\\mu + \\sigma^2)\\) is?",
97
  "JEE Main 2025 Laws of Motion": "A massless spring gets elongated by amount x_1 under a tension of 5 N . Its elongation is x_2 under the tension of 7 N . For the elongation of 5x_1 - 2x_2 , the tension in the spring will be?"
98
  }
99
 
@@ -157,9 +157,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
157
  clear_button = gr.Button("Clear", scale=1)
158
  gr.Markdown("**Try these examples:**")
159
  with gr.Row():
160
- example1_button = gr.Button("JEE Main 2025\nCombinatorics")
161
- example2_button = gr.Button("JEE Main 2025\nCoordinate Geometry")
162
- example3_button = gr.Button("JEE Main 2025\nProbability & Statistics")
163
  example4_button = gr.Button("JEE Main 2025\nLaws of Motion")
164
 
165
  def update_conversation_list():
@@ -216,9 +216,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
216
  outputs=[current_convo_id, history_state, chatbot]
217
  )
218
 
219
- example1_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Combinatorics"]), inputs=None, outputs=user_input)
220
- example2_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Coordinate Geometry"]), inputs=None, outputs=user_input)
221
- example3_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Probability & Statistics"]), inputs=None, outputs=user_input)
222
  example4_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Laws of Motion"]), inputs=None, outputs=user_input)
223
 
224
  #demo.launch(share=True, ssr_mode=False)
 
91
 
92
 
93
  example_messages = {
94
+ "JEE Main 2025 Mathematics": "From all the English alphabets, five letters are chosen and are arranged in alphabetical order. The total number of ways, in which the middle letter is 'M', is?",
95
+ "Quant Interview Puzzle": "There is a 6x8 rectangular chocolate bar made up of small 1x1 bits. We want to break it into the 48 bits. We can break one piece of chocolate horizontally or vertically, but cannot break two pieces together! What is the minimum number of breaks required?",
96
+ "JEE Advanced 2024 Mathematics": "A student appears for a quiz consisting of only true-false type questions and answers all the questions. The student knows the answers of some questions and guesses the answers for the remaining questions. Whenever the student knows the answer of a question, he gives the correct answer. Assume that probability of the student giving the correct answer for a question, given that he has guessed it, is $\\frac{1}{2}$. Also assume that the probability of the answer for a question being guessed, given that the student's answer is correct, is $\\frac{1}{6}$. Then the probability that the student knows the answer of a randomly chosen question is?",
97
  "JEE Main 2025 Laws of Motion": "A massless spring gets elongated by amount x_1 under a tension of 5 N . Its elongation is x_2 under the tension of 7 N . For the elongation of 5x_1 - 2x_2 , the tension in the spring will be?"
98
  }
99
 
 
157
  clear_button = gr.Button("Clear", scale=1)
158
  gr.Markdown("**Try these examples:**")
159
  with gr.Row():
160
+ example1_button = gr.Button("JEE Main 2025\nMathematics")
161
+ example2_button = gr.Button("Quant Interview\nPuzzle")
162
+ example3_button = gr.Button("JEE Advanced 2024\nMathematics")
163
  example4_button = gr.Button("JEE Main 2025\nLaws of Motion")
164
 
165
  def update_conversation_list():
 
216
  outputs=[current_convo_id, history_state, chatbot]
217
  )
218
 
219
+ example1_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Mathematics"]), inputs=None, outputs=user_input)
220
+ example2_button.click(fn=lambda: gr.update(value=example_messages["Quant Interview Puzzle"]), inputs=None, outputs=user_input)
221
+ example3_button.click(fn=lambda: gr.update(value=example_messages["JEE Advanced 2024 Mathematics"]), inputs=None, outputs=user_input)
222
  example4_button.click(fn=lambda: gr.update(value=example_messages["JEE Main 2025 Laws of Motion"]), inputs=None, outputs=user_input)
223
 
224
  #demo.launch(share=True, ssr_mode=False)