Add right container
Browse files- app.py +7 -0
- src/display/css_html_js.py +20 -0
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from apscheduler.schedulers.background import BackgroundScheduler
|
3 |
from huggingface_hub import snapshot_download
|
|
|
4 |
|
5 |
from src.about import (
|
6 |
REPRODUCIBILITY_TEXT,
|
@@ -51,12 +52,18 @@ AGENTIC_LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PAT
|
|
51 |
pending_eval_queue_df,
|
52 |
) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
53 |
|
|
|
|
|
|
|
|
|
54 |
def init_leaderboard(dataframe, benchmark_type):
|
55 |
if dataframe is None or dataframe.empty:
|
56 |
raise ValueError("Leaderboard DataFrame is empty or None.")
|
57 |
|
58 |
AutoEvalColumnSubset = [c for c in fields(AutoEvalColumn) if ((c.name=="Model") or (TASK_NAME_INVERSE_MAP.get(c.name, dict()).get("type", "")==benchmark_type))]
|
59 |
|
|
|
|
|
60 |
return gr.components.Dataframe(
|
61 |
value=dataframe,
|
62 |
datatype=[c.type for c in AutoEvalColumnSubset],
|
|
|
1 |
import gradio as gr
|
2 |
from apscheduler.schedulers.background import BackgroundScheduler
|
3 |
from huggingface_hub import snapshot_download
|
4 |
+
import pandas as pd
|
5 |
|
6 |
from src.about import (
|
7 |
REPRODUCIBILITY_TEXT,
|
|
|
52 |
pending_eval_queue_df,
|
53 |
) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
54 |
|
55 |
+
def bold_max(s):
|
56 |
+
is_max = s == s.max() # Boolean Series: True for the max value(s)
|
57 |
+
return ['font-weight: bold' if v else '' for v in is_max]
|
58 |
+
|
59 |
def init_leaderboard(dataframe, benchmark_type):
|
60 |
if dataframe is None or dataframe.empty:
|
61 |
raise ValueError("Leaderboard DataFrame is empty or None.")
|
62 |
|
63 |
AutoEvalColumnSubset = [c for c in fields(AutoEvalColumn) if ((c.name=="Model") or (TASK_NAME_INVERSE_MAP.get(c.name, dict()).get("type", "")==benchmark_type))]
|
64 |
|
65 |
+
# styler = dataframe.style.apply(bold_max, subset=pd.IndexSlice[:, dataframe.columns[1:]])
|
66 |
+
|
67 |
return gr.components.Dataframe(
|
68 |
value=dataframe,
|
69 |
datatype=[c.type for c in AutoEvalColumnSubset],
|
src/display/css_html_js.py
CHANGED
@@ -81,6 +81,20 @@ custom_css = """
|
|
81 |
|
82 |
#right-container {
|
83 |
flex: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
.llm-benchmark-tab-table .table-wrap table.table {
|
@@ -106,6 +120,12 @@ custom_css = """
|
|
106 |
#left-container #white-logo {
|
107 |
display: block;
|
108 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
.benchmark-table-container table {
|
|
|
81 |
|
82 |
#right-container {
|
83 |
flex: 1;
|
84 |
+
align-self: center;
|
85 |
+
}
|
86 |
+
|
87 |
+
#right-container #black-logo, #right-container #white-logo {
|
88 |
+
height: 150px;
|
89 |
+
width: 150px;
|
90 |
+
}
|
91 |
+
|
92 |
+
#right-container #black-logo {
|
93 |
+
display: block;
|
94 |
+
}
|
95 |
+
|
96 |
+
#right-container #white-logo {
|
97 |
+
display: none;
|
98 |
}
|
99 |
|
100 |
.llm-benchmark-tab-table .table-wrap table.table {
|
|
|
120 |
#left-container #white-logo {
|
121 |
display: block;
|
122 |
}
|
123 |
+
#right-container #black-logo {
|
124 |
+
display: none;
|
125 |
+
}
|
126 |
+
#right-container #white-logo {
|
127 |
+
display: block;
|
128 |
+
}
|
129 |
}
|
130 |
|
131 |
.benchmark-table-container table {
|