MCPcopy Create free account
hub / github.com/InternScience/SciReason / average_rows

Function average_rows

opencompass/summarizers/multi_model.py:48–60  ·  view source on GitHub ↗
(name, rows: List[List[str]])

Source from the content-addressed store, hash-verified

46
47
48def average_rows(name, rows: List[List[str]]) -> List[str]:
49 # name: col=0 的名字
50 new_row = ['-'] * len(rows[0])
51 new_row[0] = bold(name)
52
53 all_accs = defaultdict(list)
54 for row in rows:
55 for i, acc in enumerate(row[META_COL_COUNT:]):
56 all_accs[i].append(to_float(acc))
57
58 for i, accs in enumerate(all_accs.values()):
59 new_row[META_COL_COUNT + i] = format_float(np.mean(accs))
60 return new_row
61
62
63def create_section_row(row_i: int, row: List[str], table) -> List[str]:

Callers 2

create_section_rowFunction · 0.85
summarizeMethod · 0.85

Calls 4

boldFunction · 0.85
to_floatFunction · 0.85
format_floatFunction · 0.85
meanMethod · 0.80

Tested by

no test coverage detected