onekq commited on
Commit
c19bdc2
1 Parent(s): 126a4c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -36,14 +36,14 @@ def filter_data(model, scenario):
36
  return pd.DataFrame([pass_at_k])
37
 
38
  # Initialize the leaderboard
39
- def init_leaderboard(dataframe, height=600):
40
  if dataframe is None or dataframe.empty:
41
  raise ValueError("Leaderboard DataFrame is empty or None.")
42
  return Leaderboard(
43
  value=dataframe,
44
  datatype=["markdown", "number", "number", "number"], # Specify the types of your columns
45
  select_columns=SelectColumns(
46
- default_selection=["Model", "pass@1", "pass@5", "pass@10"], # Columns to display by default
47
  cant_deselect=[], # Columns that cannot be deselected
48
  label="Select Columns to Display:",
49
  ),
@@ -81,7 +81,7 @@ with demo:
81
  'pass@10': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 10).mean()
82
  }, index=['pass@1', 'pass@5', 'pass@10'])).reset_index()
83
 
84
- duo_leaderboard = init_leaderboard(duo_complete_pass_at_k, height=800)
85
  leaderboard = init_leaderboard(complete_pass_at_k, height=800)
86
 
87
  # Launch the Gradio interface
 
36
  return pd.DataFrame([pass_at_k])
37
 
38
  # Initialize the leaderboard
39
+ def init_leaderboard(dataframe, default_selection=["Model", "pass@1", "pass@5", "pass@10"], height=600):
40
  if dataframe is None or dataframe.empty:
41
  raise ValueError("Leaderboard DataFrame is empty or None.")
42
  return Leaderboard(
43
  value=dataframe,
44
  datatype=["markdown", "number", "number", "number"], # Specify the types of your columns
45
  select_columns=SelectColumns(
46
+ default_selection=default_selection, # Columns to display by default
47
  cant_deselect=[], # Columns that cannot be deselected
48
  label="Select Columns to Display:",
49
  ),
 
81
  'pass@10': estimate_pass_at_k(x['Runs'].values, x['Successes'].values, 10).mean()
82
  }, index=['pass@1', 'pass@5', 'pass@10'])).reset_index()
83
 
84
+ duo_leaderboard = init_leaderboard(duo_complete_pass_at_k, default_selection = ["Model", "pass@1"], height=400)
85
  leaderboard = init_leaderboard(complete_pass_at_k, height=800)
86
 
87
  # Launch the Gradio interface