UI tweaks
Browse files- app.py +10 -10
- config/format_mappings.py +6 -6
app.py
CHANGED
|
@@ -198,7 +198,7 @@ with gr.Blocks() as interface:
|
|
| 198 |
gr.HTML(
|
| 199 |
"""
|
| 200 |
<div style="margin-bottom: 10px;">
|
| 201 |
-
<span style="font-size: 1.5em; cursor: help;" title="Diagnose exercise
|
| 202 |
ℹ️ <i>←</i>
|
| 203 |
</span>
|
| 204 |
</div>
|
|
@@ -216,13 +216,13 @@ with gr.Blocks() as interface:
|
|
| 216 |
exercise_format_validate = gr.Dropdown(
|
| 217 |
choices=["Markdown", "XML", "Plaintext", "Raw (input unconverted)"],
|
| 218 |
value="Markdown",
|
| 219 |
-
label="Exercise Format
|
| 220 |
interactive=True,
|
| 221 |
)
|
| 222 |
sampling_count_validate = gr.Dropdown(
|
| 223 |
choices=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
| 224 |
value="1",
|
| 225 |
-
label="
|
| 226 |
interactive=True,
|
| 227 |
)
|
| 228 |
# Set up a change callback so that if the user selects any model with "Claude" in the name, the exercise format updates to "XML"
|
|
@@ -232,7 +232,7 @@ with gr.Blocks() as interface:
|
|
| 232 |
outputs=[exercise_format_validate]
|
| 233 |
)
|
| 234 |
|
| 235 |
-
diagnoser_input = gr.Textbox(label="Enter exercise
|
| 236 |
diagnoser_button = gr.Button("Submit")
|
| 237 |
diagnoser_response_1 = gr.Textbox(label="Response 1", interactive=False)
|
| 238 |
diagnoser_response_2 = gr.Textbox(label="Response 2", interactive=False)
|
|
@@ -246,12 +246,12 @@ with gr.Blocks() as interface:
|
|
| 246 |
diagnoser_response_10 = gr.Textbox(label="Response 10", interactive=False)
|
| 247 |
|
| 248 |
|
| 249 |
-
with gr.TabItem("🤔
|
| 250 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 251 |
gr.HTML(
|
| 252 |
"""
|
| 253 |
<div style="margin-bottom: 10px;">
|
| 254 |
-
<span style="font-size: 1.5em; cursor: help;" title="Generate alternative distractors for the given exercise. Works with 2x2 brainstorming prompts (2 approaches, each using LLM 1 & LLM 2 once) and a final consolidation prompt.">
|
| 255 |
ℹ️
|
| 256 |
</span>
|
| 257 |
</div>
|
|
@@ -263,7 +263,7 @@ with gr.Blocks() as interface:
|
|
| 263 |
model_choice_distractors_1 = gr.Dropdown(
|
| 264 |
choices=list(llms.keys()),
|
| 265 |
value="GPT-4o (low temp)",
|
| 266 |
-
label="
|
| 267 |
interactive=True,
|
| 268 |
)
|
| 269 |
model_choice_distractors_2 = gr.Dropdown(
|
|
@@ -281,20 +281,20 @@ with gr.Blocks() as interface:
|
|
| 281 |
sampling_count_distractors = gr.Dropdown(
|
| 282 |
choices=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
| 283 |
value="1",
|
| 284 |
-
label="
|
| 285 |
interactive=True,
|
| 286 |
)
|
| 287 |
intermediate_distractors_specification = gr.Dropdown(
|
| 288 |
choices=["", "2", "3", "4", "5", "6", "7", "8", "9", "10", "a few", "some", "a whole lot of", "a wide range of", "novel"],
|
| 289 |
value="8",
|
| 290 |
-
label="
|
| 291 |
interactive=True,
|
| 292 |
)
|
| 293 |
final_distractors_specification = gr.Dropdown(
|
| 294 |
choices=["all unique distractors", "the best distractors", "only the very best distractors", "4", "5", "6", "7", "8", "9", "10", "11", "12", "a few", "some", "a whole lot of",
|
| 295 |
"a wide range of", "novel"],
|
| 296 |
value="all unique distractors",
|
| 297 |
-
label="
|
| 298 |
interactive=True,
|
| 299 |
)
|
| 300 |
# Set up a change callback so that if the user selects any model with "Claude" in the name, the exercise format updates to "XML"
|
|
|
|
| 198 |
gr.HTML(
|
| 199 |
"""
|
| 200 |
<div style="margin-bottom: 10px;">
|
| 201 |
+
<span style="font-size: 1.5em; cursor: help;" title="Diagnose exercise for the 4 most common issues. The Exercise Format dropdown decides into what standardized format the exercise is converted initially for intermediate processing, to ensure reliable performance and consistent results. Claude typically works better with XML, OpenAI better with markdown. Sampling count = amount of responses.">
|
| 202 |
ℹ️ <i>←</i>
|
| 203 |
</span>
|
| 204 |
</div>
|
|
|
|
| 216 |
exercise_format_validate = gr.Dropdown(
|
| 217 |
choices=["Markdown", "XML", "Plaintext", "Raw (input unconverted)"],
|
| 218 |
value="Markdown",
|
| 219 |
+
label="Exercise Format (for intermediate processing",
|
| 220 |
interactive=True,
|
| 221 |
)
|
| 222 |
sampling_count_validate = gr.Dropdown(
|
| 223 |
choices=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
| 224 |
value="1",
|
| 225 |
+
label="Response Count",
|
| 226 |
interactive=True,
|
| 227 |
)
|
| 228 |
# Set up a change callback so that if the user selects any model with "Claude" in the name, the exercise format updates to "XML"
|
|
|
|
| 232 |
outputs=[exercise_format_validate]
|
| 233 |
)
|
| 234 |
|
| 235 |
+
diagnoser_input = gr.Textbox(label="Enter exercise in any format", placeholder="Exercise body: <mc:exercise xmlns:mc= ...")
|
| 236 |
diagnoser_button = gr.Button("Submit")
|
| 237 |
diagnoser_response_1 = gr.Textbox(label="Response 1", interactive=False)
|
| 238 |
diagnoser_response_2 = gr.Textbox(label="Response 2", interactive=False)
|
|
|
|
| 246 |
diagnoser_response_10 = gr.Textbox(label="Response 10", interactive=False)
|
| 247 |
|
| 248 |
|
| 249 |
+
with gr.TabItem("🤔 Brainstorm distractors"):
|
| 250 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 251 |
gr.HTML(
|
| 252 |
"""
|
| 253 |
<div style="margin-bottom: 10px;">
|
| 254 |
+
<span style="font-size: 1.5em; cursor: help;" title="Generate alternative distractors for the given exercise. Works with 2x2 brainstorming prompts (2 approaches, each using LLM 1 & LLM 2 once) and a final consolidation prompt combining all results together to present to the user.">
|
| 255 |
ℹ️
|
| 256 |
</span>
|
| 257 |
</div>
|
|
|
|
| 263 |
model_choice_distractors_1 = gr.Dropdown(
|
| 264 |
choices=list(llms.keys()),
|
| 265 |
value="GPT-4o (low temp)",
|
| 266 |
+
label="LLM 1",
|
| 267 |
interactive=True,
|
| 268 |
)
|
| 269 |
model_choice_distractors_2 = gr.Dropdown(
|
|
|
|
| 281 |
sampling_count_distractors = gr.Dropdown(
|
| 282 |
choices=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
| 283 |
value="1",
|
| 284 |
+
label="Response Count",
|
| 285 |
interactive=True,
|
| 286 |
)
|
| 287 |
intermediate_distractors_specification = gr.Dropdown(
|
| 288 |
choices=["", "2", "3", "4", "5", "6", "7", "8", "9", "10", "a few", "some", "a whole lot of", "a wide range of", "novel"],
|
| 289 |
value="8",
|
| 290 |
+
label="Brainstorm X intermediate distractors (done x4)",
|
| 291 |
interactive=True,
|
| 292 |
)
|
| 293 |
final_distractors_specification = gr.Dropdown(
|
| 294 |
choices=["all unique distractors", "the best distractors", "only the very best distractors", "4", "5", "6", "7", "8", "9", "10", "11", "12", "a few", "some", "a whole lot of",
|
| 295 |
"a wide range of", "novel"],
|
| 296 |
value="all unique distractors",
|
| 297 |
+
label="Finally display X distractors",
|
| 298 |
interactive=True,
|
| 299 |
)
|
| 300 |
# Set up a change callback so that if the user selects any model with "Claude" in the name, the exercise format updates to "XML"
|
config/format_mappings.py
CHANGED
|
@@ -3,17 +3,17 @@
|
|
| 3 |
FORMAT_MAPPINGS = {
|
| 4 |
"Markdown": (
|
| 5 |
"Please format the exercise in Markdown, similarly to this example:\n\n"
|
| 6 |
-
"**Theorie
|
| 7 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 8 |
"---\n\n"
|
| 9 |
-
"**Vraag
|
| 10 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 11 |
"1. Het gevoel geen connectie te hebben met anderen \n"
|
| 12 |
"2. Regelmatig in je eentje zijn \n"
|
| 13 |
"3. Beide bovenstaande \n"
|
| 14 |
"4. Geen van bovenstaande \n\n"
|
| 15 |
"**Correct antwoord:** \n"
|
| 16 |
-
"1. Het gevoel geen connectie te hebben met anderen
|
| 17 |
),
|
| 18 |
"XML": (
|
| 19 |
"Please reformat in XML, following this example:\n"
|
|
@@ -38,15 +38,15 @@ FORMAT_MAPPINGS = {
|
|
| 38 |
),
|
| 39 |
"Plaintext": (
|
| 40 |
"Please reformat in plain text, following this example:\n\n"
|
| 41 |
-
"Theorie
|
| 42 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 43 |
-
"Vraag
|
| 44 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 45 |
"1. Het gevoel geen connectie te hebben met anderen\n"
|
| 46 |
"2. Regelmatig in je eentje zijn\n"
|
| 47 |
"3. Beide bovenstaande\n"
|
| 48 |
"4. Geen van bovenstaande\n\n"
|
| 49 |
"Correct antwoord:\n"
|
| 50 |
-
"1. Het gevoel geen connectie te hebben met anderen
|
| 51 |
)
|
| 52 |
}
|
|
|
|
| 3 |
FORMAT_MAPPINGS = {
|
| 4 |
"Markdown": (
|
| 5 |
"Please format the exercise in Markdown, similarly to this example:\n\n"
|
| 6 |
+
"**Theorie:** \n"
|
| 7 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 8 |
"---\n\n"
|
| 9 |
+
"**Vraag:** \n"
|
| 10 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 11 |
"1. Het gevoel geen connectie te hebben met anderen \n"
|
| 12 |
"2. Regelmatig in je eentje zijn \n"
|
| 13 |
"3. Beide bovenstaande \n"
|
| 14 |
"4. Geen van bovenstaande \n\n"
|
| 15 |
"**Correct antwoord:** \n"
|
| 16 |
+
"1. Het gevoel geen connectie te hebben met anderen"
|
| 17 |
),
|
| 18 |
"XML": (
|
| 19 |
"Please reformat in XML, following this example:\n"
|
|
|
|
| 38 |
),
|
| 39 |
"Plaintext": (
|
| 40 |
"Please reformat in plain text, following this example:\n\n"
|
| 41 |
+
"Theorie:\n"
|
| 42 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 43 |
+
"Vraag:\n"
|
| 44 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 45 |
"1. Het gevoel geen connectie te hebben met anderen\n"
|
| 46 |
"2. Regelmatig in je eentje zijn\n"
|
| 47 |
"3. Beide bovenstaande\n"
|
| 48 |
"4. Geen van bovenstaande\n\n"
|
| 49 |
"Correct antwoord:\n"
|
| 50 |
+
"1. Het gevoel geen connectie te hebben met anderen"
|
| 51 |
)
|
| 52 |
}
|