kennymckormick commited on
Commit
63ffee3
1 Parent(s): 0c31bc1

add 'Rank'

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -25,14 +25,18 @@ with gr.Blocks() as demo:
25
  _, check_box = BUILD_L1_DF(results, MAIN_FIELDS)
26
  table = generate_table(results, DEFAULT_BENCH)
27
  table['Rank'] = list(range(1, len(table) + 1))
 
28
  type_map = check_box['type_map']
 
 
29
  checkbox_group = gr.CheckboxGroup(
30
  choices=check_box['all'],
31
  value=check_box['required'],
32
  label='Evaluation Dimension',
33
  interactive=True,
34
  )
35
- headers = check_box['essential'] + checkbox_group.value
 
36
  with gr.Row():
37
  model_size = gr.CheckboxGroup(
38
  choices=MODEL_SIZE,
@@ -55,7 +59,8 @@ with gr.Blocks() as demo:
55
 
56
  def filter_df(fields, model_size, model_type):
57
  filter_list = ['Avg Score', 'Avg Rank', 'OpenSource', 'Verified']
58
- headers = check_box['essential'] + fields
 
59
  new_fields = [field for field in fields if field not in filter_list]
60
  df = generate_table(results, new_fields)
61
 
@@ -90,13 +95,17 @@ with gr.Blocks() as demo:
90
  s = structs[i]
91
  s.table, s.check_box = BUILD_L2_DF(results, dataset)
92
  s.type_map = s.check_box['type_map']
 
 
93
  s.checkbox_group = gr.CheckboxGroup(
94
  choices=s.check_box['all'],
95
  value=s.check_box['required'],
96
  label=f'{dataset} CheckBoxes',
97
  interactive=True,
98
  )
99
- s.headers = s.check_box['essential'] + s.checkbox_group.value
 
 
100
  with gr.Row():
101
  s.model_size = gr.CheckboxGroup(
102
  choices=MODEL_SIZE,
@@ -120,7 +129,7 @@ with gr.Blocks() as demo:
120
 
121
  def filter_df_l2(dataset_name, fields, model_size, model_type):
122
  s = structs[DATASETS.index(dataset_name)]
123
- headers = s.check_box['essential'] + fields
124
  df = cp.deepcopy(s.table)
125
  df['flag'] = [model_size_flag(x, model_size) for x in df['Param (B)']]
126
  df = df[df['flag']]
@@ -129,6 +138,7 @@ with gr.Blocks() as demo:
129
  df['flag'] = [model_type_flag(df.iloc[i], model_type) for i in range(len(df))]
130
  df = df[df['flag']]
131
  df.pop('flag')
 
132
 
133
  comp = gr.components.DataFrame(
134
  value=df[headers],
 
25
  _, check_box = BUILD_L1_DF(results, MAIN_FIELDS)
26
  table = generate_table(results, DEFAULT_BENCH)
27
  table['Rank'] = list(range(1, len(table) + 1))
28
+
29
  type_map = check_box['type_map']
30
+ type_map['Rank'] = 'number'
31
+
32
  checkbox_group = gr.CheckboxGroup(
33
  choices=check_box['all'],
34
  value=check_box['required'],
35
  label='Evaluation Dimension',
36
  interactive=True,
37
  )
38
+
39
+ headers = ['Rank'] + check_box['essential'] + checkbox_group.value
40
  with gr.Row():
41
  model_size = gr.CheckboxGroup(
42
  choices=MODEL_SIZE,
 
59
 
60
  def filter_df(fields, model_size, model_type):
61
  filter_list = ['Avg Score', 'Avg Rank', 'OpenSource', 'Verified']
62
+ headers = ['Rank'] + check_box['essential'] + fields
63
+
64
  new_fields = [field for field in fields if field not in filter_list]
65
  df = generate_table(results, new_fields)
66
 
 
95
  s = structs[i]
96
  s.table, s.check_box = BUILD_L2_DF(results, dataset)
97
  s.type_map = s.check_box['type_map']
98
+ s.type_map['Rank'] = 'number'
99
+
100
  s.checkbox_group = gr.CheckboxGroup(
101
  choices=s.check_box['all'],
102
  value=s.check_box['required'],
103
  label=f'{dataset} CheckBoxes',
104
  interactive=True,
105
  )
106
+ s.headers = ['Rank'] + s.check_box['essential'] + s.checkbox_group.values
107
+ s.table['Rank'] = list(range(1, len(s.table) + 1))
108
+
109
  with gr.Row():
110
  s.model_size = gr.CheckboxGroup(
111
  choices=MODEL_SIZE,
 
129
 
130
  def filter_df_l2(dataset_name, fields, model_size, model_type):
131
  s = structs[DATASETS.index(dataset_name)]
132
+ headers = ['Rank'] + s.check_box['essential'] + fields
133
  df = cp.deepcopy(s.table)
134
  df['flag'] = [model_size_flag(x, model_size) for x in df['Param (B)']]
135
  df = df[df['flag']]
 
138
  df['flag'] = [model_type_flag(df.iloc[i], model_type) for i in range(len(df))]
139
  df = df[df['flag']]
140
  df.pop('flag')
141
+ df['Rank'] = list(range(1, len(df) + 1))
142
 
143
  comp = gr.components.DataFrame(
144
  value=df[headers],