Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
"
|
| 108 |
-
"
|
| 109 |
-
"
|
| 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=
|
| 132 |
maximum=16384, # Fathom’s context window is 16K
|
| 133 |
step=1024,
|
| 134 |
-
value=
|
| 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("
|
| 177 |
-
example2_button = gr.Button("
|
| 178 |
-
example3_button = gr.Button("Physics
|
| 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["
|
| 198 |
inputs=None,
|
| 199 |
outputs=user_input
|
| 200 |
)
|
| 201 |
example2_button.click(
|
| 202 |
-
fn=lambda: gr.update(value=example_messages["
|
| 203 |
inputs=None,
|
| 204 |
outputs=user_input
|
| 205 |
)
|
| 206 |
example3_button.click(
|
| 207 |
-
fn=lambda: gr.update(value=example_messages["Physics
|
| 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 |
)
|