Spaces:
Running
Running
BenchmarkBot
commited on
Commit
β’
18b69eb
1
Parent(s):
8985298
added number of params
Browse files- app.py +5 -3
- src/utils.py +12 -0
app.py
CHANGED
@@ -5,7 +5,7 @@ import plotly.express as px
|
|
5 |
from apscheduler.schedulers.background import BackgroundScheduler
|
6 |
|
7 |
from src.assets.text_content import TITLE, INTRODUCTION_TEXT, SINGLE_A100_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT
|
8 |
-
from src.utils import restart_space, load_dataset_repo, make_clickable_model, make_clickable_score
|
9 |
from src.assets.css_html_js import custom_css
|
10 |
|
11 |
|
@@ -17,12 +17,13 @@ COLUMNS_MAPPING = {
|
|
17 |
"model": "Model π€",
|
18 |
"backend.name": "Backend π",
|
19 |
"backend.torch_dtype": "Load Dtype π₯",
|
|
|
20 |
"forward.peak_memory(MB)": "Peak Memory (MB) β¬οΈ",
|
21 |
"generate.throughput(tokens/s)": "Throughput (tokens/s) β¬οΈ",
|
22 |
"h4_score": "Average Open LLM Score β¬οΈ",
|
23 |
-
|
24 |
}
|
25 |
-
COLUMNS_DATATYPES = ["markdown", "str", "str",
|
|
|
26 |
SORTING_COLUMN = ["Throughput (tokens/s) β¬οΈ"]
|
27 |
|
28 |
|
@@ -55,6 +56,7 @@ def get_benchmark_table(bench_df):
|
|
55 |
bench_df["Model π€"] = bench_df["Model π€"].apply(make_clickable_model)
|
56 |
bench_df["Average Open LLM Score β¬οΈ"] = bench_df["Average Open LLM Score β¬οΈ"].apply(
|
57 |
make_clickable_score)
|
|
|
58 |
|
59 |
return bench_df
|
60 |
|
|
|
5 |
from apscheduler.schedulers.background import BackgroundScheduler
|
6 |
|
7 |
from src.assets.text_content import TITLE, INTRODUCTION_TEXT, SINGLE_A100_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT
|
8 |
+
from src.utils import restart_space, load_dataset_repo, make_clickable_model, make_clickable_score, num_to_str
|
9 |
from src.assets.css_html_js import custom_css
|
10 |
|
11 |
|
|
|
17 |
"model": "Model π€",
|
18 |
"backend.name": "Backend π",
|
19 |
"backend.torch_dtype": "Load Dtype π₯",
|
20 |
+
"num_parameters": "#Parameters π",
|
21 |
"forward.peak_memory(MB)": "Peak Memory (MB) β¬οΈ",
|
22 |
"generate.throughput(tokens/s)": "Throughput (tokens/s) β¬οΈ",
|
23 |
"h4_score": "Average Open LLM Score β¬οΈ",
|
|
|
24 |
}
|
25 |
+
COLUMNS_DATATYPES = ["markdown", "str", "str",
|
26 |
+
"number", "number", "number", "markdown"]
|
27 |
SORTING_COLUMN = ["Throughput (tokens/s) β¬οΈ"]
|
28 |
|
29 |
|
|
|
56 |
bench_df["Model π€"] = bench_df["Model π€"].apply(make_clickable_model)
|
57 |
bench_df["Average Open LLM Score β¬οΈ"] = bench_df["Average Open LLM Score β¬οΈ"].apply(
|
58 |
make_clickable_score)
|
59 |
+
bench_df["#Parameters π"] = bench_df["#Parameters π"].apply(num_to_str)
|
60 |
|
61 |
return bench_df
|
62 |
|
src/utils.py
CHANGED
@@ -66,3 +66,15 @@ def make_clickable_model(model_name):
|
|
66 |
def make_clickable_score(score):
|
67 |
link = f"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard"
|
68 |
return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{score}</a>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
def make_clickable_score(score):
|
67 |
link = f"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard"
|
68 |
return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{score}</a>'
|
69 |
+
|
70 |
+
|
71 |
+
def num_to_str(num):
|
72 |
+
if num < 1000:
|
73 |
+
return str(int(num))
|
74 |
+
elif num < 1000000:
|
75 |
+
return str(int(num / 1000)) + "K"
|
76 |
+
elif num < 1000000000:
|
77 |
+
return str(int(num / 1000000)) + "M"
|
78 |
+
elif num < 1000000000000:
|
79 |
+
return str(int(num / 1000000000)) + "B"
|
80 |
+
return None
|