FractalAIR commited on
Commit
ae84060
·
verified ·
1 Parent(s): 55861c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -104,9 +104,9 @@ def generate_response(user_message, max_tokens, temperature, top_k, top_p, repet
104
 
105
  # Example prompts
106
  example_messages = {
107
- "Math reasoning": "If a rectangular prism has a length of 6 cm, a width of 4 cm, and a height of 5 cm, what is the length of the longest line segment that can be drawn from one vertex to another?",
108
- "Logic puzzle": "Four people (Alex, Blake, Casey, and Dana) each have a different favorite color (red, blue, green, yellow) and a different favorite fruit (apple, banana, cherry, date). Given the following clues: 1) The person who likes red doesn't like dates. 2) Alex likes yellow. 3) The person who likes blue likes cherries. 4) Blake doesn't like apples or bananas. 5) Casey doesn't like yellow or green. Who likes what color and what fruit?",
109
- "Physics problem": "A ball is thrown upward with an initial velocity of 15 m/s from a height of 2 meters above the ground. Assuming the acceleration due to gravity is 9.8 m/s², determine: 1) The maximum height the ball reaches. 2) The total time the ball is in the air before hitting the ground. 3) The velocity with which the ball hits the ground."
110
  }
111
 
112
  # Gradio interface
@@ -128,10 +128,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
128
  with gr.Column(scale=1):
129
  gr.Markdown("### Settings")
130
  max_tokens_slider = gr.Slider(
131
- minimum=64,
132
  maximum=16384, # Fathom’s context window is 16K
133
  step=1024,
134
- value=4096,
135
  label="Max Tokens"
136
  )
137
  with gr.Accordion("Advanced Settings", open=False):
@@ -173,9 +173,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
173
  clear_button = gr.Button("Clear", scale=1)
174
  gr.Markdown("**Try these examples:**")
175
  with gr.Row():
176
- example1_button = gr.Button("Math reasoning")
177
- example2_button = gr.Button("Logic puzzle")
178
- example3_button = gr.Button("Physics problem")
179
 
180
  submit_button.click(
181
  fn=generate_response,
@@ -194,17 +194,17 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
194
  )
195
 
196
  example1_button.click(
197
- fn=lambda: gr.update(value=example_messages["Math reasoning"]),
198
  inputs=None,
199
  outputs=user_input
200
  )
201
  example2_button.click(
202
- fn=lambda: gr.update(value=example_messages["Logic puzzle"]),
203
  inputs=None,
204
  outputs=user_input
205
  )
206
  example3_button.click(
207
- fn=lambda: gr.update(value=example_messages["Physics problem"]),
208
  inputs=None,
209
  outputs=user_input
210
  )
 
104
 
105
  # Example prompts
106
  example_messages = {
107
+ "IIT-JEE 2025 Physics": "A person sitting inside an elevator performs a weighing experiment with an object of mass 50 kg. Suppose that the variation of the height 𝑦 (in m) of the elevator, from the ground, with time 𝑡 (in s) is given by 𝑦 = 8 [1 + sin ( 2𝜋𝑡/𝑇 )], where 𝑇 = 40𝜋 s. Taking acceleration due to gravity, 𝑔 = 10 m/s^2 , the maximum variation of the object’s weight (in N) as observed in the experiment is ?",
108
+ "Goldman Sachs Interview Puzzle": "Four friends need to cross a dangerous bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?",
109
+ "IIT-JEE 2025 Mathematics": "Let 𝑆 be the set of all seven-digit numbers that can be formed using the digits 0, 1 and 2. For example, 2210222 is in 𝑆, but 0210222 is NOT in 𝑆.Then the number of elements 𝑥 in 𝑆 such that at least one of the digits 0 and 1 appears exactly twice in 𝑥, is ?"
110
  }
111
 
112
  # Gradio interface
 
128
  with gr.Column(scale=1):
129
  gr.Markdown("### Settings")
130
  max_tokens_slider = gr.Slider(
131
+ minimum=8192,
132
  maximum=16384, # Fathom’s context window is 16K
133
  step=1024,
134
+ value=16384,
135
  label="Max Tokens"
136
  )
137
  with gr.Accordion("Advanced Settings", open=False):
 
173
  clear_button = gr.Button("Clear", scale=1)
174
  gr.Markdown("**Try these examples:**")
175
  with gr.Row():
176
+ example1_button = gr.Button("IIT-JEE 2025 Mathematics")
177
+ example2_button = gr.Button("Goldman Sachs Interview Puzzle")
178
+ example3_button = gr.Button("IIT-JEE 2025 Physics")
179
 
180
  submit_button.click(
181
  fn=generate_response,
 
194
  )
195
 
196
  example1_button.click(
197
+ fn=lambda: gr.update(value=example_messages["IIT-JEE 2025 Mathematics"]),
198
  inputs=None,
199
  outputs=user_input
200
  )
201
  example2_button.click(
202
+ fn=lambda: gr.update(value=example_messages["Goldman Sachs Interview Puzzle"]),
203
  inputs=None,
204
  outputs=user_input
205
  )
206
  example3_button.click(
207
+ fn=lambda: gr.update(value=example_messages["IIT-JEE 2025 Physics"]),
208
  inputs=None,
209
  outputs=user_input
210
  )