pufanyi commited on
Commit
5f9b8de
·
1 Parent(s): 9e76fbd

Refactor init_leaderboard function to use the last subset as the default value for the dropdown

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -69,8 +69,9 @@ LEADERBOARD_DF, SUBSETS = get_leaderboard_df(RESULTS_REPO)
69
 
70
 
71
  def init_leaderboard(dataframes, subsets):
72
- selected_subset = gr.Dropdown(choices=subsets, label="Select Dataset Subset", value=subsets[0])
73
-
 
74
  return Leaderboard(
75
  value=dataframes,
76
  datatype=[c.type for c in fields(AutoEvalColumn)],
 
69
 
70
 
71
  def init_leaderboard(dataframes, subsets):
72
+ subsets = list(subsets)
73
+ selected_subset = gr.Dropdown(choices=subsets, label="Select Dataset Subset", value=subsets[-1])
74
+
75
  return Leaderboard(
76
  value=dataframes,
77
  datatype=[c.type for c in fields(AutoEvalColumn)],