BenchmarkBot commited on
Commit
a600c79
β€’
1 Parent(s): f0729a8

fix sorting

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -89,17 +89,18 @@ def get_benchmark_df(benchmark="1xA100-80GB"):
89
 
90
 
91
  def get_benchmark_table(bench_df):
92
- # filter
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)
 
89
 
90
 
91
  def get_benchmark_table(bench_df):
 
 
 
 
92
  # sort based on composite score made by adding score, -latency, -memory each normalized to values between 0 and 1
93
  normalized_score =(bench_df["score"]-bench_df["score"].min())/(bench_df["score"].max()-bench_df["score"].min())
94
  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())
95
  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())
96
  bench_df["composite_score"] = normalized_score + normalized_latency + normalized_memory
97
  bench_df.sort_values(by=["composite_score"], ascending=False, inplace=True)
98
+
99
+ # filter
100
+ bench_df = bench_df[list(COLUMNS_MAPPING.keys())]
101
+ # rename
102
+ bench_df.rename(columns=COLUMNS_MAPPING, inplace=True)
103
+
104
  # transform
105
  bench_df["Model πŸ€—"] = bench_df["Model πŸ€—"].apply(make_clickable_model)
106
  bench_df["#️⃣ Parameters πŸ“"] = bench_df["#️⃣ Parameters πŸ“"].apply(num_to_str)