mgyigit commited on
Commit
87921bb
·
verified ·
1 Parent(s): 21913be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -107,6 +107,11 @@ def update_metrics(selected_benchmarks):
107
  def update_leaderboard(selected_methods, selected_metrics):
108
  return get_baseline_df(selected_methods, selected_metrics)
109
 
 
 
 
 
 
110
  # ------- Visualisation helpers ---------------------------------------------
111
 
112
 
@@ -216,9 +221,14 @@ with block:
216
  baseline_header = ["Method"] + metric_names
217
  baseline_datatype = ['markdown'] + ['number'] * len(metric_names)
218
 
 
 
 
 
 
219
  with gr.Row(show_progress=True, variant='panel'):
220
  data_component = gr.Dataframe(
221
- value=baseline_value,
222
  headers=baseline_header,
223
  type="pandas",
224
  datatype=baseline_datatype,
@@ -226,6 +236,7 @@ with block:
226
  elem_id="leaderboard-table",
227
  pinned_columns=1,
228
  max_height=1000,
 
229
  )
230
 
231
  # callbacks
 
107
  def update_leaderboard(selected_methods, selected_metrics):
108
  return get_baseline_df(selected_methods, selected_metrics)
109
 
110
+ def style_methods(val):
111
+ """Given a model name, return a CSS style string."""
112
+ c = color_dict.get(val, "black")
113
+ return f"color: {c}"
114
+
115
  # ------- Visualisation helpers ---------------------------------------------
116
 
117
 
 
221
  baseline_header = ["Method"] + metric_names
222
  baseline_datatype = ['markdown'] + ['number'] * len(metric_names)
223
 
224
+ baseline_styler = baseline_value.style.applymap(
225
+ style_methods,
226
+ subset=["Method"]
227
+ )
228
+
229
  with gr.Row(show_progress=True, variant='panel'):
230
  data_component = gr.Dataframe(
231
+ value=baseline_styler,
232
  headers=baseline_header,
233
  type="pandas",
234
  datatype=baseline_datatype,
 
236
  elem_id="leaderboard-table",
237
  pinned_columns=1,
238
  max_height=1000,
239
+ show_fullscreen_button=True
240
  )
241
 
242
  # callbacks