Spaces:
Running
Running
Heatmap: Second heatmap added
Browse files
server.py
CHANGED
|
@@ -840,13 +840,39 @@ class LeaderboardServer:
|
|
| 840 |
sorted_indices = sizes_series.sort_values(ascending=False).index
|
| 841 |
original_scores = original_scores.loc[sorted_indices] # Sort rows by model size
|
| 842 |
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 846 |
y_axis_label=fig_y_axis_label,
|
| 847 |
)
|
| 848 |
|
| 849 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 850 |
|
| 851 |
def get_leaderboard_csv(self, pre_submit=None, category=None, kind_of_p_value=None):
|
| 852 |
if pre_submit == None:
|
|
|
|
| 840 |
sorted_indices = sizes_series.sort_values(ascending=False).index
|
| 841 |
original_scores = original_scores.loc[sorted_indices] # Sort rows by model size
|
| 842 |
|
| 843 |
+
# Smaller models
|
| 844 |
+
original_scores_sub = original_scores[sizes_series < 16]
|
| 845 |
+
|
| 846 |
+
# Apply quantile transformation independently for each row
|
| 847 |
+
normalized_scores_sub = original_scores_sub.apply(lambda x: (x - x.min()) / (x.max() - x.min()), axis=0)
|
| 848 |
+
|
| 849 |
+
# Call the heatmap function with the normalized data
|
| 850 |
+
p1 = create_heatmap(
|
| 851 |
+
normalized_scores_sub,
|
| 852 |
+
original_scores_sub * 100,
|
| 853 |
+
x_axis_label="Model < 16B",
|
| 854 |
y_axis_label=fig_y_axis_label,
|
| 855 |
)
|
| 856 |
|
| 857 |
+
# Bigger models
|
| 858 |
+
original_scores_sub = original_scores[sizes_series >= 16]
|
| 859 |
+
|
| 860 |
+
# Apply quantile transformation independently for each row
|
| 861 |
+
normalized_scores_sub = original_scores_sub.apply(lambda x: (x - x.min()) / (x.max() - x.min()), axis=0)
|
| 862 |
+
|
| 863 |
+
# Call the heatmap function with the normalized data
|
| 864 |
+
p2 = create_heatmap(
|
| 865 |
+
normalized_scores_sub,
|
| 866 |
+
original_scores_sub * 100,
|
| 867 |
+
x_axis_label="Model >= 16B",
|
| 868 |
+
y_axis_label=fig_y_axis_label,
|
| 869 |
+
y_axis_visible=False,
|
| 870 |
+
)
|
| 871 |
+
|
| 872 |
+
from bokeh.layouts import row
|
| 873 |
+
layout = row(p1, p2)
|
| 874 |
+
|
| 875 |
+
return layout
|
| 876 |
|
| 877 |
def get_leaderboard_csv(self, pre_submit=None, category=None, kind_of_p_value=None):
|
| 878 |
if pre_submit == None:
|