Spaces:
Running
Running
BenchmarkBot
commited on
Commit
β’
f0729a8
1
Parent(s):
fbc8c87
added composite score sorting
Browse files
app.py
CHANGED
@@ -36,6 +36,7 @@ COLUMNS_MAPPING = {
|
|
36 |
"forward.peak_memory(MB)": "Peak Memory (MB) β¬οΈ",
|
37 |
"score": "Average Open LLM Score β¬οΈ",
|
38 |
#
|
|
|
39 |
"num_params": "#οΈβ£ Parameters π",
|
40 |
}
|
41 |
COLUMNS_DATATYPES = [
|
@@ -92,8 +93,13 @@ def get_benchmark_table(bench_df):
|
|
92 |
bench_df = bench_df[list(COLUMNS_MAPPING.keys())]
|
93 |
# rename
|
94 |
bench_df.rename(columns=COLUMNS_MAPPING, inplace=True)
|
95 |
-
# sort
|
96 |
-
bench_df.
|
|
|
|
|
|
|
|
|
|
|
97 |
# transform
|
98 |
bench_df["Model π€"] = bench_df["Model π€"].apply(make_clickable_model)
|
99 |
bench_df["#οΈβ£ Parameters π"] = bench_df["#οΈβ£ Parameters π"].apply(num_to_str)
|
|
|
36 |
"forward.peak_memory(MB)": "Peak Memory (MB) β¬οΈ",
|
37 |
"score": "Average Open LLM Score β¬οΈ",
|
38 |
#
|
39 |
+
"composite_score": "Composite Score β¬οΈ",
|
40 |
"num_params": "#οΈβ£ Parameters π",
|
41 |
}
|
42 |
COLUMNS_DATATYPES = [
|
|
|
93 |
bench_df = bench_df[list(COLUMNS_MAPPING.keys())]
|
94 |
# rename
|
95 |
bench_df.rename(columns=COLUMNS_MAPPING, inplace=True)
|
96 |
+
# sort based on composite score made by adding score, -latency, -memory each normalized to values between 0 and 1
|
97 |
+
normalized_score =(bench_df["score"]-bench_df["score"].min())/(bench_df["score"].max()-bench_df["score"].min())
|
98 |
+
normalized_latency = (bench_df["generate.latency(s)"].max()-bench_df["generate.latency(s)"])/(bench_df["generate.latency(s)"].max()-bench_df["generate.latency(s)"].min())
|
99 |
+
normalized_memory = (bench_df["forward.peak_memory(MB)"].max()-bench_df["forward.peak_memory(MB)"])/(bench_df["forward.peak_memory(MB)"].max()-bench_df["forward.peak_memory(MB)"].min())
|
100 |
+
bench_df["composite_score"] = normalized_score + normalized_latency + normalized_memory
|
101 |
+
bench_df.sort_values(by=["composite_score"], ascending=False, inplace=True)
|
102 |
+
|
103 |
# transform
|
104 |
bench_df["Model π€"] = bench_df["Model π€"].apply(make_clickable_model)
|
105 |
bench_df["#οΈβ£ Parameters π"] = bench_df["#οΈβ£ Parameters π"].apply(num_to_str)
|