albertvillanova HF staff commited on
Commit
54e105e
1 Parent(s): 26ef426

Add checkbox in Results to hide stderr

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. src/results.py +8 -3
app.py CHANGED
@@ -63,6 +63,7 @@ with gr.Blocks(fill_height=True, fill_width=True) as demo:
63
  lines=3,
64
  visible=False,
65
  )
 
66
  results = gr.HTML()
67
  with gr.Tab("Configs"):
68
  load_configs_btn = gr.Button("Load", interactive=False)
@@ -140,9 +141,9 @@ with gr.Blocks(fill_height=True, fill_width=True) as demo:
140
  )
141
  # Display results
142
  gr.on(
143
- triggers=[dataframe_1.change, dataframe_2.change, results_task.change],
144
  fn=display_results,
145
- inputs=[results_task, dataframe_1, dataframe_2],
146
  outputs=[results, configs],
147
  )
148
  gr.on(
 
63
  lines=3,
64
  visible=False,
65
  )
66
+ hide_errors = gr.Checkbox(label="Hide Errors", value=True, info="Options")
67
  results = gr.HTML()
68
  with gr.Tab("Configs"):
69
  load_configs_btn = gr.Button("Load", interactive=False)
 
141
  )
142
  # Display results
143
  gr.on(
144
+ triggers=[dataframe_1.change, dataframe_2.change, results_task.change, hide_errors.change],
145
  fn=display_results,
146
+ inputs=[results_task, hide_errors, dataframe_1, dataframe_2],
147
  outputs=[results, configs],
148
  )
149
  gr.on(
src/results.py CHANGED
@@ -51,16 +51,19 @@ async def load_results_dataframes(*model_ids, result_paths_per_model=None):
51
  return result
52
 
53
 
54
- def display_results(task, *dfs):
55
  dfs = [df.set_index("index") for df in dfs if "index" in df.columns]
56
  if not dfs:
57
  return None, None
58
  df = pd.concat(dfs)
59
  df = df.T.rename_axis(columns=None)
60
- return display_tab("results", df, task), display_tab("configs", df, task)
 
 
 
61
 
62
 
63
- def display_tab(tab, df, task):
64
  df = df.style.format(escape="html", na_rep="")
65
  df.hide(
66
  [
@@ -75,6 +78,8 @@ def display_tab(tab, df, task):
75
  if task != "All"
76
  else row.startswith(f"{tab}.leaderboard_arc_challenge")
77
  )
 
 
78
  )
79
  ],
80
  axis="index",
 
51
  return result
52
 
53
 
54
+ def display_results(task, hide_errors, *dfs):
55
  dfs = [df.set_index("index") for df in dfs if "index" in df.columns]
56
  if not dfs:
57
  return None, None
58
  df = pd.concat(dfs)
59
  df = df.T.rename_axis(columns=None)
60
+ return (
61
+ display_tab("results", df, task, hide_errors=hide_errors),
62
+ display_tab("configs", df, task),
63
+ )
64
 
65
 
66
+ def display_tab(tab, df, task, hide_errors=True):
67
  df = df.style.format(escape="html", na_rep="")
68
  df.hide(
69
  [
 
78
  if task != "All"
79
  else row.startswith(f"{tab}.leaderboard_arc_challenge")
80
  )
81
+ # Hide errors
82
+ or (hide_errors and row.endswith("_stderr,none"))
83
  )
84
  ],
85
  axis="index",