djstrong commited on
Commit
f7bb3a0
1 Parent(s): 647e0eb

gradient working

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import subprocess
2
  import gradio as gr
 
3
  import pandas as pd
4
  from apscheduler.schedulers.background import BackgroundScheduler
5
  from huggingface_hub import snapshot_download
@@ -77,13 +78,14 @@ def update_table(
77
  show_deleted: bool,
78
  query: str,
79
  ):
80
- print('1', len(hidden_df))
81
  filtered_df = filter_models(hidden_df, type_query, size_query, nshot_query, precision_query, show_deleted)
82
- print('2', len(filtered_df))
83
  filtered_df = filter_queries(query, filtered_df)
84
- print('3', len(filtered_df))
85
  df = select_columns(filtered_df, columns)
86
- print('4', len(df))
 
87
 
88
  leaderboard_df_styled = df.style.background_gradient(cmap="viridis")
89
  # leaderboard_df_styled = leaderboard_df_styled.format("{:.2f}")
@@ -226,6 +228,7 @@ with demo:
226
  ]
227
  leaderboard_df_styled = leaderboard_table_value.style.background_gradient(cmap="viridis")
228
  # leaderboard_df_styled = leaderboard_df_styled.format("{:.2f}")
 
229
 
230
  leaderboard_table = gr.components.Dataframe(
231
  value=leaderboard_df_styled,
 
1
  import subprocess
2
  import gradio as gr
3
+ import numpy as np
4
  import pandas as pd
5
  from apscheduler.schedulers.background import BackgroundScheduler
6
  from huggingface_hub import snapshot_download
 
78
  show_deleted: bool,
79
  query: str,
80
  ):
81
+
82
  filtered_df = filter_models(hidden_df, type_query, size_query, nshot_query, precision_query, show_deleted)
83
+
84
  filtered_df = filter_queries(query, filtered_df)
85
+
86
  df = select_columns(filtered_df, columns)
87
+
88
+ df = df.replace({'': np.nan})
89
 
90
  leaderboard_df_styled = df.style.background_gradient(cmap="viridis")
91
  # leaderboard_df_styled = leaderboard_df_styled.format("{:.2f}")
 
228
  ]
229
  leaderboard_df_styled = leaderboard_table_value.style.background_gradient(cmap="viridis")
230
  # leaderboard_df_styled = leaderboard_df_styled.format("{:.2f}")
231
+ leaderboard_df_styled.precision = 2
232
 
233
  leaderboard_table = gr.components.Dataframe(
234
  value=leaderboard_df_styled,