Skip to content

Commit ce98758

Browse files
small bugfix
1 parent 505f1fa commit ce98758

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

cybench/runs/analysis/model_family_radar_lib.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ def _family_records(
155155
representatives: dict[str, str],
156156
) -> list[dict[str, Any]]:
157157
view_labels = [v["label"] for v in EVALUATION_VIEWS]
158+
rep_models = [model for model in representatives.values() if model in medians.index]
159+
rel_all = (
160+
relative_scores(medians.loc[rep_models].copy())
161+
if rep_models
162+
else pd.DataFrame()
163+
)
164+
158165
rows: list[dict[str, Any]] = []
159166
for family, model in representatives.items():
160167
if model not in medians.index:
@@ -164,10 +171,12 @@ def _family_records(
164171
for view in EVALUATION_VIEWS:
165172
val = raw_row.get(view["metric"])
166173
raw[view["metric"]] = None if pd.isna(val) else round(float(val), 4)
167-
frame = medians.loc[[model]].copy()
168-
rel = relative_scores(frame)
169174
relative = {
170-
label: round(float(rel[label].iloc[0]), 4) if label in rel.columns else None
175+
label: (
176+
round(float(rel_all[label].loc[model]), 4)
177+
if label in rel_all.columns and model in rel_all.index
178+
else None
179+
)
171180
for label in view_labels
172181
}
173182
rows.append(

0 commit comments

Comments
 (0)