rohansampath commited on
Commit
9d60cf6
·
verified ·
1 Parent(s): b5e28ab

Update run_evaluation.py

Browse files
Files changed (1) hide show
  1. 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, # Report markdown
124
- comparison_df, # Results dataframe
125
- gr.Button.update(interactive=True), # Enable eval button
126
- gr.Button.update(interactive=False), # Disable cancel button
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 values for all 10 components
141
- return (
142
- error_message, # Error message in markdown
143
- None, # No dataframe
144
- gr.Button.update(interactive=True), # Enable eval button
145
- gr.Button.update(interactive=False), # Disable cancel button
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
+ }