Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,7 +204,7 @@ with gr.Blocks(css="""
|
|
| 204 |
num_subjects_slider = gr.Slider(
|
| 205 |
minimum=1,
|
| 206 |
maximum=14, # Will be updated dynamically based on preview data
|
| 207 |
-
value=
|
| 208 |
step=1,
|
| 209 |
label="Number of Subjects",
|
| 210 |
info="Number of subjects to evaluate. They will be loaded in alphabetical order."
|
|
@@ -230,7 +230,7 @@ with gr.Blocks(css="""
|
|
| 230 |
value=5,
|
| 231 |
step=1,
|
| 232 |
label="Number of Few-shot Examples",
|
| 233 |
-
info="Number of examples to use for few-shot learning (0-5)."
|
| 234 |
)
|
| 235 |
|
| 236 |
# Add a small space
|
|
@@ -242,7 +242,7 @@ with gr.Blocks(css="""
|
|
| 242 |
value=False,
|
| 243 |
info="When checked, evaluates all available questions for each subject"
|
| 244 |
)
|
| 245 |
-
questions_info_text = gr.Markdown(visible=False, value="**All
|
| 246 |
|
| 247 |
with gr.Row(elem_id="questions_selection_row"):
|
| 248 |
questions_container = gr.Column(scale=1, elem_id="questions_slider_container")
|
|
@@ -285,6 +285,7 @@ with gr.Blocks(css="""
|
|
| 285 |
# Function to process dataset preview data
|
| 286 |
def get_subject_choices_from_preview(preview_data):
|
| 287 |
if not preview_data or 'subject_counts' not in preview_data:
|
|
|
|
| 288 |
return [], 0
|
| 289 |
|
| 290 |
# Get subject counts from preview data
|
|
@@ -295,6 +296,8 @@ with gr.Blocks(css="""
|
|
| 295 |
|
| 296 |
# Format as "Subject (n=count)"
|
| 297 |
formatted_subjects = [f"{subject} (n={subject_counts[subject]})" for subject in subjects]
|
|
|
|
|
|
|
| 298 |
|
| 299 |
return formatted_subjects, len(subjects)
|
| 300 |
|
|
@@ -311,7 +314,7 @@ with gr.Blocks(css="""
|
|
| 311 |
return (
|
| 312 |
preview_data, # Store the preview data
|
| 313 |
gr.update(choices=subject_choices), # Update checkbox choices
|
| 314 |
-
gr.update(maximum=subject_count, value=
|
| 315 |
)
|
| 316 |
return None, gr.update(), gr.update()
|
| 317 |
|
|
|
|
| 204 |
num_subjects_slider = gr.Slider(
|
| 205 |
minimum=1,
|
| 206 |
maximum=14, # Will be updated dynamically based on preview data
|
| 207 |
+
value=1,
|
| 208 |
step=1,
|
| 209 |
label="Number of Subjects",
|
| 210 |
info="Number of subjects to evaluate. They will be loaded in alphabetical order."
|
|
|
|
| 230 |
value=5,
|
| 231 |
step=1,
|
| 232 |
label="Number of Few-shot Examples",
|
| 233 |
+
info="Number of examples to use for few-shot learning (0-5). They will be loaded in order of question_id."
|
| 234 |
)
|
| 235 |
|
| 236 |
# Add a small space
|
|
|
|
| 242 |
value=False,
|
| 243 |
info="When checked, evaluates all available questions for each subject"
|
| 244 |
)
|
| 245 |
+
questions_info_text = gr.Markdown(visible=False, value="**All questions across the selected subjects will be evaluated**")
|
| 246 |
|
| 247 |
with gr.Row(elem_id="questions_selection_row"):
|
| 248 |
questions_container = gr.Column(scale=1, elem_id="questions_slider_container")
|
|
|
|
| 285 |
# Function to process dataset preview data
|
| 286 |
def get_subject_choices_from_preview(preview_data):
|
| 287 |
if not preview_data or 'subject_counts' not in preview_data:
|
| 288 |
+
print("FAILURE HERE")
|
| 289 |
return [], 0
|
| 290 |
|
| 291 |
# Get subject counts from preview data
|
|
|
|
| 296 |
|
| 297 |
# Format as "Subject (n=count)"
|
| 298 |
formatted_subjects = [f"{subject} (n={subject_counts[subject]})" for subject in subjects]
|
| 299 |
+
print("Formatted Subjects", formatted_subjects)
|
| 300 |
+
|
| 301 |
|
| 302 |
return formatted_subjects, len(subjects)
|
| 303 |
|
|
|
|
| 314 |
return (
|
| 315 |
preview_data, # Store the preview data
|
| 316 |
gr.update(choices=subject_choices), # Update checkbox choices
|
| 317 |
+
gr.update(maximum=subject_count, value=1) # Update slider max
|
| 318 |
)
|
| 319 |
return None, gr.update(), gr.update()
|
| 320 |
|