mgyigit commited on
Commit
bd5bc53
·
verified ·
1 Parent(s): 01432f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -103,12 +103,15 @@ def update_metrics(selected_benchmarks):
103
  updated_metrics.update(benchmark_metric_mapping.get(benchmark, []))
104
  return list(updated_metrics)
105
 
106
-
107
  def update_leaderboard(selected_methods, selected_metrics):
108
- df = get_baseline_df(selected_methods, selected_metrics)
109
- df = df.applymap(lambda x: round(x, 4) if isinstance(x, (int, float)) else x)
110
- df['Method'] = df['Method'].apply(format_method)
111
- return df
 
 
 
 
112
 
113
 
114
  def format_method(name: str) -> str:
 
103
  updated_metrics.update(benchmark_metric_mapping.get(benchmark, []))
104
  return list(updated_metrics)
105
 
 
106
  def update_leaderboard(selected_methods, selected_metrics):
107
+ df = get_baseline_df(selected_methods, selected_metrics).round(4)
108
+ styler = (
109
+ df.style
110
+ .applymap(style_method, subset=["Method"])
111
+ .apply(highlight_top5, axis=0)
112
+ .format(precision=4)
113
+ )
114
+ return styler
115
 
116
 
117
  def format_method(name: str) -> str: