Bigger tabs?
Browse files
app.py
CHANGED
|
@@ -86,7 +86,7 @@ with gr.Blocks() as demo:
|
|
| 86 |
|
| 87 |
# --- Main App (initially hidden) ---
|
| 88 |
with gr.Column(visible=False, elem_id="main_app") as app_container:
|
| 89 |
-
gr.Markdown("## Pick the tab for your task of choice below
|
| 90 |
# Dropdown for LLM selection.
|
| 91 |
# Create a row for the control dropdowns
|
| 92 |
with gr.Row():
|
|
@@ -105,23 +105,35 @@ with gr.Blocks() as demo:
|
|
| 105 |
sampling_count = gr.Dropdown(
|
| 106 |
choices=["1", "2🚧", "3🚧", "4🚧", "5🚧"],
|
| 107 |
value="1",
|
| 108 |
-
label="Sampling Count",
|
| 109 |
interactive=True,
|
| 110 |
)
|
| 111 |
-
# Set up a change callback so that if the user selects "
|
| 112 |
model_choice.change(
|
| 113 |
fn=update_exercise_format,
|
| 114 |
inputs=[model_choice],
|
| 115 |
outputs=[exercise_format]
|
| 116 |
)
|
| 117 |
with gr.Tabs():
|
| 118 |
-
with gr.TabItem("Validate exercise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 120 |
gr.HTML(
|
| 121 |
"""
|
| 122 |
<div style="margin-bottom: 10px;">
|
| 123 |
<span style="font-size: 1.5em; cursor: help;" title="Diagnoses potential issues for the given exercise(s).">
|
| 124 |
-
|
| 125 |
</span>
|
| 126 |
</div>
|
| 127 |
"""
|
|
@@ -129,7 +141,7 @@ with gr.Blocks() as demo:
|
|
| 129 |
diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc=...")
|
| 130 |
diagnoser_button = gr.Button("Submit")
|
| 131 |
diagnoser_output = gr.Textbox(label="Diagnosis", interactive=False)
|
| 132 |
-
with gr.TabItem("Generate distractors
|
| 133 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 134 |
gr.HTML(
|
| 135 |
"""
|
|
@@ -143,7 +155,7 @@ with gr.Blocks() as demo:
|
|
| 143 |
distractors_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Paste your exercise here...")
|
| 144 |
distractors_button = gr.Button("Submit")
|
| 145 |
distractors_output = gr.Textbox(label="Response", interactive=False)
|
| 146 |
-
with gr.TabItem("Generate learning objectives
|
| 147 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 148 |
gr.HTML(
|
| 149 |
"""
|
|
@@ -154,9 +166,9 @@ with gr.Blocks() as demo:
|
|
| 154 |
</div>
|
| 155 |
"""
|
| 156 |
)
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
|
| 161 |
# -------------------------------
|
| 162 |
# Set Up Interactions
|
|
|
|
| 86 |
|
| 87 |
# --- Main App (initially hidden) ---
|
| 88 |
with gr.Column(visible=False, elem_id="main_app") as app_container:
|
| 89 |
+
gr.Markdown("## Pick the tab for your task of choice below")
|
| 90 |
# Dropdown for LLM selection.
|
| 91 |
# Create a row for the control dropdowns
|
| 92 |
with gr.Row():
|
|
|
|
| 105 |
sampling_count = gr.Dropdown(
|
| 106 |
choices=["1", "2🚧", "3🚧", "4🚧", "5🚧"],
|
| 107 |
value="1",
|
| 108 |
+
label="Sampling Count 🚧",
|
| 109 |
interactive=True,
|
| 110 |
)
|
| 111 |
+
# Set up a change callback so that if the user selects "Claude3.5", the exercise format updates to "XML"
|
| 112 |
model_choice.change(
|
| 113 |
fn=update_exercise_format,
|
| 114 |
inputs=[model_choice],
|
| 115 |
outputs=[exercise_format]
|
| 116 |
)
|
| 117 |
with gr.Tabs():
|
| 118 |
+
with gr.TabItem("🩺 Validate exercise"):
|
| 119 |
+
# Insert custom CSS to enlarge the tab content
|
| 120 |
+
gr.HTML(
|
| 121 |
+
"""
|
| 122 |
+
<style>
|
| 123 |
+
.tab-content {
|
| 124 |
+
font-size: 1.2em; /* Increase text size */
|
| 125 |
+
padding: 20px; /* Add more padding inside the tab */
|
| 126 |
+
}
|
| 127 |
+
</style>
|
| 128 |
+
"""
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 132 |
gr.HTML(
|
| 133 |
"""
|
| 134 |
<div style="margin-bottom: 10px;">
|
| 135 |
<span style="font-size: 1.5em; cursor: help;" title="Diagnoses potential issues for the given exercise(s).">
|
| 136 |
+
ℹ️ <i>← mouseover for more info</i>
|
| 137 |
</span>
|
| 138 |
</div>
|
| 139 |
"""
|
|
|
|
| 141 |
diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc=...")
|
| 142 |
diagnoser_button = gr.Button("Submit")
|
| 143 |
diagnoser_output = gr.Textbox(label="Diagnosis", interactive=False)
|
| 144 |
+
with gr.TabItem("🤔 Generate distractors"):
|
| 145 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 146 |
gr.HTML(
|
| 147 |
"""
|
|
|
|
| 155 |
distractors_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Paste your exercise here...")
|
| 156 |
distractors_button = gr.Button("Submit")
|
| 157 |
distractors_output = gr.Textbox(label="Response", interactive=False)
|
| 158 |
+
with gr.TabItem("🚧 Generate learning objectives"):
|
| 159 |
# Insert an HTML info icon with a tooltip at the top of the tab content.
|
| 160 |
gr.HTML(
|
| 161 |
"""
|
|
|
|
| 166 |
</div>
|
| 167 |
"""
|
| 168 |
)
|
| 169 |
+
learning_objectives_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Paste your study text here...")
|
| 170 |
+
learning_objectives_button = gr.Button("Submit")
|
| 171 |
+
learning_objectives_output = gr.Textbox(label="Response", interactive=False)
|
| 172 |
|
| 173 |
# -------------------------------
|
| 174 |
# Set Up Interactions
|