Spaces:
Runtime error
Runtime error
Adding missing values as -inf in red
Browse files- app.py +2 -2
- src/leaderboard/read_evals.py +2 -2
app.py
CHANGED
@@ -147,7 +147,7 @@ def update_table_and_plot(
|
|
147 |
df = (df.style
|
148 |
.format(precision=2, thousands=",", decimal=".")
|
149 |
.highlight_max(props="background-color: lightgreen; color: black;", axis=0, subset=df.columns[1:])
|
150 |
-
.highlight_between(props="color: red;", axis=0, subset=df.columns[1:], left=-np.inf, right
|
151 |
)
|
152 |
fig = plot_stats(DATA_PATH, columns=columns, table=df)
|
153 |
return df, fig
|
@@ -278,7 +278,7 @@ with demo:
|
|
278 |
.highlight_max(props="background-color: lightgreen; color: black;", axis=0,
|
279 |
subset=cols_to_show[1:])
|
280 |
.highlight_between(props="color: red;", axis=0,
|
281 |
-
subset=cols_to_show[1:], left=-np.inf, right
|
282 |
),
|
283 |
headers=[c.name for c in fields(AutoEvalColumn) if c.never_hidden] + shown_columns.value,
|
284 |
datatype=TYPES,
|
|
|
147 |
df = (df.style
|
148 |
.format(precision=2, thousands=",", decimal=".")
|
149 |
.highlight_max(props="background-color: lightgreen; color: black;", axis=0, subset=df.columns[1:])
|
150 |
+
.highlight_between(props="color: red;", axis=0, subset=df.columns[1:], left=-np.inf, right=-np.inf)
|
151 |
)
|
152 |
fig = plot_stats(DATA_PATH, columns=columns, table=df)
|
153 |
return df, fig
|
|
|
278 |
.highlight_max(props="background-color: lightgreen; color: black;", axis=0,
|
279 |
subset=cols_to_show[1:])
|
280 |
.highlight_between(props="color: red;", axis=0,
|
281 |
+
subset=cols_to_show[1:], left=-np.inf, right=-np.inf)
|
282 |
),
|
283 |
headers=[c.name for c in fields(AutoEvalColumn) if c.never_hidden] + shown_columns.value,
|
284 |
datatype=TYPES,
|
src/leaderboard/read_evals.py
CHANGED
@@ -91,7 +91,7 @@ class EvalResult:
|
|
91 |
# We average all scores of a given metric (not all metrics are present in all files)
|
92 |
accs = np.array([v.get(task.metric, None) for k, v in data["results"].items() if task.benchmark == k])
|
93 |
if accs.size == 0 or any([acc is None for acc in accs]):
|
94 |
-
accs = np.array([
|
95 |
|
96 |
mean_acc = np.mean(accs) * 100.0
|
97 |
results[task.benchmark] = mean_acc
|
@@ -126,7 +126,7 @@ class EvalResult:
|
|
126 |
|
127 |
def to_dict(self):
|
128 |
"""Converts the Eval Result to a dict compatible with our dataframe display"""
|
129 |
-
average = sum([v for v in self.results.values() if v
|
130 |
data_dict = {
|
131 |
"eval_name": self.eval_name, # not a column, just a save name,
|
132 |
# AutoEvalColumn.precision.name: self.precision.value.name,
|
|
|
91 |
# We average all scores of a given metric (not all metrics are present in all files)
|
92 |
accs = np.array([v.get(task.metric, None) for k, v in data["results"].items() if task.benchmark == k])
|
93 |
if accs.size == 0 or any([acc is None for acc in accs]):
|
94 |
+
accs = np.array([-np.inf])
|
95 |
|
96 |
mean_acc = np.mean(accs) * 100.0
|
97 |
results[task.benchmark] = mean_acc
|
|
|
126 |
|
127 |
def to_dict(self):
|
128 |
"""Converts the Eval Result to a dict compatible with our dataframe display"""
|
129 |
+
average = sum([v for v in self.results.values() if v not in (-np.inf, None)]) / len(Tasks)
|
130 |
data_dict = {
|
131 |
"eval_name": self.eval_name, # not a column, just a save name,
|
132 |
# AutoEvalColumn.precision.name: self.precision.value.name,
|