rohansampath commited on
Commit
1642f78
·
verified ·
1 Parent(s): 33231b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -85,8 +85,11 @@ def run_mmlu_evaluation(all_subjects, num_subjects, num_shots, all_questions, nu
85
  load_model()
86
 
87
  if not model_loaded:
88
- return "⚠️ Model not loaded. Please load the model first.", None, gr.update(interactive=True), gr.update(visible=False), \
89
- [gr.update(interactive=True) for _ in range(5)]
 
 
 
90
 
91
  # Convert num_subjects to -1 if all_subjects is True
92
  if all_subjects:
@@ -145,8 +148,11 @@ def run_mmlu_evaluation(all_subjects, num_subjects, num_shots, all_questions, nu
145
  )
146
 
147
  # Return values that re-enable UI components after completion
148
- return report, results_df, gr.update(interactive=True), gr.update(visible=False), \
149
- [gr.update(interactive=True) for _ in range(5)]
 
 
 
150
 
151
  # ---------------------------------------------------------------------------
152
  # 4. Gradio Interface
@@ -319,9 +325,13 @@ with gr.Blocks() as demo:
319
  outputs=[
320
  results_output,
321
  results_table,
322
- eval_mmlu_button,
323
  cancel_mmlu_button,
324
- [all_subjects_checkbox, num_subjects_slider, num_shots_slider, all_questions_checkbox, num_questions_slider]
 
 
 
 
325
  ]
326
  )
327
 
 
85
  load_model()
86
 
87
  if not model_loaded:
88
+ return ("⚠️ Model not loaded. Please load the model first.", None,
89
+ gr.update(interactive=True), gr.update(visible=False),
90
+ gr.update(interactive=True), gr.update(interactive=True),
91
+ gr.update(interactive=True), gr.update(interactive=True),
92
+ gr.update(interactive=True))
93
 
94
  # Convert num_subjects to -1 if all_subjects is True
95
  if all_subjects:
 
148
  )
149
 
150
  # Return values that re-enable UI components after completion
151
+ return (report, results_df,
152
+ gr.update(interactive=True), gr.update(visible=False),
153
+ gr.update(interactive=True), gr.update(interactive=True),
154
+ gr.update(interactive=True), gr.update(interactive=True),
155
+ gr.update(interactive=True))
156
 
157
  # ---------------------------------------------------------------------------
158
  # 4. Gradio Interface
 
325
  outputs=[
326
  results_output,
327
  results_table,
328
+ eval_mmlu_button,
329
  cancel_mmlu_button,
330
+ all_subjects_checkbox,
331
+ num_subjects_slider,
332
+ num_shots_slider,
333
+ all_questions_checkbox,
334
+ num_questions_slider
335
  ]
336
  )
337