UltraRonin commited on
Commit
dbc1b2d
·
1 Parent(s): ba25dd3
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -66,9 +66,11 @@ def init_leaderboard(dataframe):
66
  raise ValueError("Leaderboard DataFrame is empty or None.")
67
 
68
  # pdb.set_trace()
 
 
69
  num_cols = dataframe.select_dtypes(include=['float']).columns
70
  styler = dataframe.style.format({col: "{:.1f}" for col in num_cols})
71
- styler = styler.highlight_max(axis=0, subset=num_cols)
72
  return gr.components.Dataframe(
73
  value=styler,
74
  headers=[c.name for c in fields(AutoEvalColumn)],
 
66
  raise ValueError("Leaderboard DataFrame is empty or None.")
67
 
68
  # pdb.set_trace()
69
+ def highlight_max_bold(s):
70
+ return ['font-weight: bold' if v == s.max() and v != s.min() else '' for v in s]
71
  num_cols = dataframe.select_dtypes(include=['float']).columns
72
  styler = dataframe.style.format({col: "{:.1f}" for col in num_cols})
73
+ styler = styler.apply(highlight_max_bold, subset=num_cols)
74
  return gr.components.Dataframe(
75
  value=styler,
76
  headers=[c.name for c in fields(AutoEvalColumn)],