Spaces:
Runtime error
Runtime error
christodoulos.constantinides@ibm.com
commited on
Commit
·
d6e7e73
1
Parent(s):
0d4fbe6
update
Browse files
src/leaderboard/read_evals.py
CHANGED
|
@@ -74,7 +74,7 @@ class EvalResult:
|
|
| 74 |
# We average all scores of a given metric (not all metrics are present in all files)
|
| 75 |
accs = np.array([v.get(task.metric, None) for k, v in data["results"].items() if task.benchmark == k])
|
| 76 |
if accs.size == 0 or any([acc is None for acc in accs]):
|
| 77 |
-
mean_acc =
|
| 78 |
else:
|
| 79 |
mean_acc = np.nanmean(accs) * 100.0
|
| 80 |
# if accs.size == 0:
|
|
@@ -113,7 +113,9 @@ class EvalResult:
|
|
| 113 |
|
| 114 |
def to_dict(self, task_class):
|
| 115 |
"""Converts the Eval Result to a dict compatible with our dataframe display"""
|
| 116 |
-
|
|
|
|
|
|
|
| 117 |
data_dict = {
|
| 118 |
"eval_name": self.eval_name, # not a column, just a save name,
|
| 119 |
AutoEvalColumn.precision.name: self.precision.value.name,
|
|
|
|
| 74 |
# We average all scores of a given metric (not all metrics are present in all files)
|
| 75 |
accs = np.array([v.get(task.metric, None) for k, v in data["results"].items() if task.benchmark == k])
|
| 76 |
if accs.size == 0 or any([acc is None for acc in accs]):
|
| 77 |
+
mean_acc = None
|
| 78 |
else:
|
| 79 |
mean_acc = np.nanmean(accs) * 100.0
|
| 80 |
# if accs.size == 0:
|
|
|
|
| 113 |
|
| 114 |
def to_dict(self, task_class):
|
| 115 |
"""Converts the Eval Result to a dict compatible with our dataframe display"""
|
| 116 |
+
scores = [v for v in self.results.values() if v is not None]
|
| 117 |
+
average = sum(scores) / len(scores)
|
| 118 |
+
# average = sum([v for v in self.results.values() if v is not None]) / len(task_class)
|
| 119 |
data_dict = {
|
| 120 |
"eval_name": self.eval_name, # not a column, just a save name,
|
| 121 |
AutoEvalColumn.precision.name: self.precision.value.name,
|