Spaces:
Sleeping
Sleeping
Update run_evaluation.py
Browse files- run_evaluation.py +11 -25
run_evaluation.py
CHANGED
@@ -119,34 +119,20 @@ def run_mmlu_evaluation(subject_selection_mode, num_subjects, selected_subjects,
|
|
119 |
comparison_df = pd.DataFrame(comparison_data)
|
120 |
|
121 |
# Format the report
|
122 |
-
return
|
123 |
-
report,
|
124 |
-
comparison_df,
|
125 |
-
|
126 |
-
|
127 |
-
gr.Radio.update(interactive=True), # Enable subject selection mode
|
128 |
-
gr.Slider.update(interactive=True), # Enable subjects slider
|
129 |
-
gr.Checkbox.update(interactive=True), # Enable all questions checkbox
|
130 |
-
gr.Slider.update(interactive=True), # Enable questions slider
|
131 |
-
gr.Dropdown.update(interactive=True), # Enable model dropdown
|
132 |
-
gr.Column.update(visible=True) # Make table container visible
|
133 |
-
)
|
134 |
|
135 |
except Exception as e:
|
136 |
# Handle errors gracefully
|
137 |
error_trace = traceback.format_exc()
|
138 |
error_message = f"### Error during evaluation\n```\n{error_trace}\n```"
|
139 |
|
140 |
-
# Return error
|
141 |
-
return
|
142 |
-
error_message,
|
143 |
-
None,
|
144 |
-
|
145 |
-
|
146 |
-
gr.Radio.update(interactive=True), # Enable subject selection mode
|
147 |
-
gr.Slider.update(interactive=True), # Enable subjects slider
|
148 |
-
gr.Checkbox.update(interactive=True), # Enable all questions checkbox
|
149 |
-
gr.Slider.update(interactive=True), # Enable questions slider
|
150 |
-
gr.Dropdown.update(interactive=True), # Enable model dropdown
|
151 |
-
gr.Column.update(visible=False) # Hide table container
|
152 |
-
)
|
|
|
119 |
comparison_df = pd.DataFrame(comparison_data)
|
120 |
|
121 |
# Format the report
|
122 |
+
return {
|
123 |
+
'report': report,
|
124 |
+
'comparison_df': comparison_df,
|
125 |
+
'success': True
|
126 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
except Exception as e:
|
129 |
# Handle errors gracefully
|
130 |
error_trace = traceback.format_exc()
|
131 |
error_message = f"### Error during evaluation\n```\n{error_trace}\n```"
|
132 |
|
133 |
+
# Return error information
|
134 |
+
return {
|
135 |
+
'report': error_message,
|
136 |
+
'comparison_df': None,
|
137 |
+
'success': False
|
138 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|