idolezal commited on
Commit
63daecf
·
1 Parent(s): 9cd1585

Revert "Try to highlight wins"

Browse files

This reverts commit 9cd1585b06cdfd8c3380689cea1a29862baaeef1.

Files changed (1) hide show
  1. server.py +8 -2
server.py CHANGED
@@ -21,7 +21,6 @@ from threading import Lock
21
 
22
  import gradio as gr
23
  import pandas as pd
24
- import numpy as np
25
  from huggingface_hub import HfApi, snapshot_download
26
 
27
  from compare_significance import SUPPORTED_METRICS
@@ -219,7 +218,14 @@ class LeaderboardServer:
219
 
220
  @staticmethod
221
  def _model_tournament_table_highlight_true(x):
222
- return np.where(x == True, 'background-color: lightgreen;', None)
 
 
 
 
 
 
 
223
 
224
  def get_model_tournament_table(self, submission_id, category):
225
  if category == self.TASKS_CATEGORY_OVERALL:
 
21
 
22
  import gradio as gr
23
  import pandas as pd
 
24
  from huggingface_hub import HfApi, snapshot_download
25
 
26
  from compare_significance import SUPPORTED_METRICS
 
218
 
219
  @staticmethod
220
  def _model_tournament_table_highlight_true(x):
221
+ df_css = x.copy()
222
+ for c in df_css:
223
+ for i in range(len(df_css.index)):
224
+ if x[c].iloc[i] == True:
225
+ df_css[c].iloc[i] = 'background-color: lightgreen'
226
+ else:
227
+ df_css[c].iloc[i] = ''
228
+ return df_css
229
 
230
  def get_model_tournament_table(self, submission_id, category):
231
  if category == self.TASKS_CATEGORY_OVERALL: