Spaces:
Running
Running
Commit
·
1c9c07a
1
Parent(s):
7b73541
feat: refactor app.py to load data from a JSONL file, enhance the leaderboard display, and improve the "About" section layout with new branding and community links. Remove outdated leaderboard_data.json file.
Browse files- README.md +1 -1
- app.py +65 -49
- assets.py +23 -0
- leaderboard_data.json +0 -0
- results.jsonl +112 -0
README.md
CHANGED
@@ -7,7 +7,7 @@ sdk: gradio
|
|
7 |
app_file: app.py
|
8 |
pinned: true
|
9 |
license: apache-2.0
|
10 |
-
short_description: A Leaderboard for Inference Providers
|
11 |
sdk_version: 5.19.0
|
12 |
---
|
13 |
|
|
|
7 |
app_file: app.py
|
8 |
pinned: true
|
9 |
license: apache-2.0
|
10 |
+
short_description: A cost/quality/speed Leaderboard for Inference Providers!
|
11 |
sdk_version: 5.19.0
|
12 |
---
|
13 |
|
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import math
|
2 |
from pathlib import Path
|
3 |
|
@@ -5,30 +6,42 @@ import gradio as gr
|
|
5 |
import pandas as pd
|
6 |
from gradio_leaderboard import ColumnFilter, Leaderboard
|
7 |
|
|
|
|
|
8 |
abs_path = Path(__file__).parent
|
9 |
|
10 |
-
#
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
df["Model"] = df.apply(
|
13 |
-
lambda row: f'<a target="_blank" href="{row["URL"]}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{row["
|
14 |
axis=1,
|
15 |
)
|
16 |
-
df = df[
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
with gr.Blocks("ParityError/Interstellar") as demo:
|
19 |
-
gr.
|
20 |
"""
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
)
|
|
|
28 |
with gr.Tabs():
|
29 |
with gr.TabItem("FLUX.1 [dev] Leaderboard"):
|
30 |
-
median_inference_time_min = math.floor(float(df["Median Inference Time
|
31 |
-
median_inference_time_max = math.ceil(float(df["Median Inference Time
|
32 |
price_per_image_min = math.floor(float(df["Price per Image"].min()))
|
33 |
price_per_image_max = math.ceil(float(df["Price per Image"].max()))
|
34 |
Leaderboard(
|
@@ -36,7 +49,7 @@ with gr.Blocks("ParityError/Interstellar") as demo:
|
|
36 |
search_columns=["Model"],
|
37 |
filter_columns=[
|
38 |
ColumnFilter(
|
39 |
-
column="Median Inference Time
|
40 |
type="slider",
|
41 |
default=[median_inference_time_min, median_inference_time_max],
|
42 |
min=median_inference_time_min,
|
@@ -54,50 +67,53 @@ with gr.Blocks("ParityError/Interstellar") as demo:
|
|
54 |
datatype="markdown",
|
55 |
)
|
56 |
with gr.TabItem("About"):
|
57 |
-
gr.
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
|
68 |
-
|
69 |
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
FLUX-juiced was obtained using a combination of compilation and caching algorithms and we are proud to say that it consistently outperforms alternatives, while delivering performance on par with the original model.
|
78 |
-
This combination is available in our Pruna Pro package and can be applied to almost every image generation model.
|
79 |
-
|
80 |
-
# 🌍 Join the Pruna AI community!
|
81 |
-
<p><a rel="nofollow" href="https://twitter.com/PrunaAI"><img alt="Twitter" src="https://img.shields.io/twitter/follow/PrunaAI?style=social"></a>
|
82 |
-
<a rel="nofollow" href="https://github.com/PrunaAI/pruna"><img alt="GitHub" src="https://img.shields.io/github/stars/prunaai/pruna"></a>
|
83 |
-
<a rel="nofollow" href="https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-Connect-blue"></a>
|
84 |
-
<a rel="nofollow" href="https://discord.com/invite/rskEr4BZJx"><img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord"></a>
|
85 |
-
<a rel="nofollow" href="https://www.reddit.com/r/PrunaAI/"><img alt="Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/PrunaAI?style=social"></a></p>
|
86 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
)
|
88 |
with gr.Accordion("Citation", open=True):
|
89 |
gr.Markdown(
|
90 |
"""
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
)
|
101 |
-
|
102 |
if __name__ == "__main__":
|
103 |
demo.launch()
|
|
|
1 |
+
import json
|
2 |
import math
|
3 |
from pathlib import Path
|
4 |
|
|
|
6 |
import pandas as pd
|
7 |
from gradio_leaderboard import ColumnFilter, Leaderboard
|
8 |
|
9 |
+
from assets import custom_css
|
10 |
+
|
11 |
abs_path = Path(__file__).parent
|
12 |
|
13 |
+
# Load the JSONL file into a pandas DataFrame using the json library
|
14 |
+
with open(abs_path / "results.jsonl", "r") as file:
|
15 |
+
json_data = file.read()
|
16 |
+
fixed_json_data = f"[{json_data.replace('}\n{', '},\n{')}]"
|
17 |
+
json_data = json.loads(fixed_json_data)
|
18 |
+
df = pd.DataFrame(json_data)
|
19 |
+
|
20 |
df["Model"] = df.apply(
|
21 |
+
lambda row: f'<a target="_blank" href="{row["URL"]}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{row["Model"]}</a>',
|
22 |
axis=1,
|
23 |
)
|
24 |
+
df = df[
|
25 |
+
["Model", "Median Inference Time", "Price per Image"]
|
26 |
+
+ [col for col in df.columns.tolist() if col not in ["URL", "Model", "Median Inference Time", "Price per Image"]]
|
27 |
+
]
|
28 |
+
df = df.sort_values(by="GenEval", ascending=False)
|
29 |
|
30 |
+
with gr.Blocks("ParityError/Interstellar", css=custom_css) as demo:
|
31 |
+
gr.HTML(
|
32 |
"""
|
33 |
+
<div style="text-align: center;">
|
34 |
+
<img src="https://huggingface.co/datasets/PrunaAI/documentation-images/resolve/main/inferbench/logo1.png" style="width: 200px; height: auto; max-width: 100%; margin: 0 auto;">
|
35 |
+
<h1>🏋️ InferBench 🏋️</h1>
|
36 |
+
<h2>A cost/quality/speed Leaderboard for Inference Providers!</h2>
|
37 |
+
</div>
|
38 |
+
"""
|
39 |
)
|
40 |
+
|
41 |
with gr.Tabs():
|
42 |
with gr.TabItem("FLUX.1 [dev] Leaderboard"):
|
43 |
+
median_inference_time_min = math.floor(float(df["Median Inference Time"].min()))
|
44 |
+
median_inference_time_max = math.ceil(float(df["Median Inference Time"].max()))
|
45 |
price_per_image_min = math.floor(float(df["Price per Image"].min()))
|
46 |
price_per_image_max = math.ceil(float(df["Price per Image"].max()))
|
47 |
Leaderboard(
|
|
|
49 |
search_columns=["Model"],
|
50 |
filter_columns=[
|
51 |
ColumnFilter(
|
52 |
+
column="Median Inference Time",
|
53 |
type="slider",
|
54 |
default=[median_inference_time_min, median_inference_time_max],
|
55 |
min=median_inference_time_min,
|
|
|
67 |
datatype="markdown",
|
68 |
)
|
69 |
with gr.TabItem("About"):
|
70 |
+
with gr.Row():
|
71 |
+
with gr.Column(scale=1):
|
72 |
+
gr.Markdown(
|
73 |
+
"""
|
74 |
+
# 💜 About Pruna AI
|
75 |
+
We are Pruna AI, an open source AI optimisation engine and we simply make your models cheaper, faster, smaller, greener!
|
76 |
|
77 |
+
# 📊 About InferBench
|
78 |
+
InferBench is a leaderboard for inference providers, focusing on cost, quality, and compression.
|
79 |
+
Over the past few years, we’ve observed outstanding progress in image generation models fueled by ever-larger architectures.
|
80 |
+
Due to their size, state-of-the-art models such as FLUX take more than 6 seconds to generate a single image on a high-end H100 GPU.
|
81 |
+
While compression techniques can reduce inference time, their impact on quality often remains unclear.
|
82 |
|
83 |
+
To bring more transparency around the quality of compressed models:
|
84 |
|
85 |
+
- We release “juiced” endpoints for popular image generation models on Replicate, making it easy to play around with our compressed models.
|
86 |
+
- We assess the quality of compressed FLUX-APIs from Replicate, fal, Fireworks AI and Together AI according to different benchmarks.
|
87 |
|
88 |
+
FLUX-juiced was obtained using a combination of compilation and caching algorithms and we are proud to say that it consistently outperforms alternatives, while delivering performance on par with the original model.
|
89 |
+
This combination is available in our Pruna Pro package and can be applied to almost every image generation model.
|
90 |
+
"""
|
91 |
+
)
|
92 |
+
with gr.Column(scale=1):
|
93 |
+
gr.Markdown("")
|
94 |
|
95 |
+
with gr.Accordion("🌍 Join the Pruna AI community!", open=False):
|
96 |
+
gr.HTML(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
"""
|
98 |
+
<a rel="nofollow" href="https://twitter.com/PrunaAI"><img alt="Twitter" src="https://img.shields.io/twitter/follow/PrunaAI?style=social"></a>
|
99 |
+
<a rel="nofollow" href="https://github.com/PrunaAI/pruna"><img alt="GitHub" src="https://img.shields.io/github/stars/prunaai/pruna"></a>
|
100 |
+
<a rel="nofollow" href="https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-Connect-blue"></a>
|
101 |
+
<a rel="nofollow" href="https://discord.com/invite/rskEr4BZJx"><img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord"></a>
|
102 |
+
<a rel="nofollow" href="https://www.reddit.com/r/PrunaAI/"><img alt="Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/PrunaAI?style=social"></a>
|
103 |
+
"""
|
104 |
)
|
105 |
with gr.Accordion("Citation", open=True):
|
106 |
gr.Markdown(
|
107 |
"""
|
108 |
+
```bibtex
|
109 |
+
@article{InferBench,
|
110 |
+
title={InferBench: A Leaderboard for Inference Providers},
|
111 |
+
author={PrunaAI},
|
112 |
+
year={2025},
|
113 |
+
howpublished={\\url{https://huggingface.co/spaces/PrunaAI/InferBench}}
|
114 |
+
}
|
115 |
+
```
|
116 |
+
"""
|
117 |
)
|
|
|
118 |
if __name__ == "__main__":
|
119 |
demo.launch()
|
assets.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
custom_css = """
|
2 |
+
.logo {
|
3 |
+
width: 300px;
|
4 |
+
height: auto;
|
5 |
+
max-width: 100%;
|
6 |
+
margin: 0 auto;
|
7 |
+
object-fit: contain;
|
8 |
+
padding-bottom: 0;
|
9 |
+
}
|
10 |
+
.text {
|
11 |
+
font-size: 16px !important;
|
12 |
+
}
|
13 |
+
.tabs button {
|
14 |
+
font-size: 20px;
|
15 |
+
}
|
16 |
+
.subtabs button {
|
17 |
+
font-size: 20px;
|
18 |
+
}
|
19 |
+
h1, h2 {
|
20 |
+
margin: 0;
|
21 |
+
padding-top: 0;
|
22 |
+
}
|
23 |
+
"""
|
leaderboard_data.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
results.jsonl
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"Model": "Baseline [Nvidia H100]",
|
3 |
+
"URL": "https://huggingface.co/black-forest-labs/FLUX.1-dev?library=diffusers",
|
4 |
+
"GenEval": 67.98,
|
5 |
+
"HPS (v2.1)": 30.36,
|
6 |
+
"GenAI-Bench (VQA)": 0.74,
|
7 |
+
"DrawBench (Image Reward)": 1.0072,
|
8 |
+
"PartiPromts (ARNIQA)": 0.6758,
|
9 |
+
"PartiPromts (ClipIQA)": 0.8968,
|
10 |
+
"PartiPromts (ClipScore)": 27.4,
|
11 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 6833,
|
12 |
+
"Median Inference Time": 6.88,
|
13 |
+
"Price per Image": 0.025
|
14 |
+
}
|
15 |
+
{
|
16 |
+
"Model": "fal",
|
17 |
+
"URL": "https://fal.ai/models/fal-ai/flux/dev",
|
18 |
+
"GenEval": 68.72,
|
19 |
+
"HPS (v2.1)": 29.97,
|
20 |
+
"GenAI-Bench (VQA)": 0.7441,
|
21 |
+
"DrawBench (Image Reward)": 1.0084,
|
22 |
+
"PartiPromts (ARNIQA)": 0.6702,
|
23 |
+
"PartiPromts (ClipIQA)": 0.8967,
|
24 |
+
"PartiPromts (ClipScore)": 27.61,
|
25 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 7295,
|
26 |
+
"Median Inference Time": 4.06,
|
27 |
+
"Price per Image": 0.025
|
28 |
+
}
|
29 |
+
{
|
30 |
+
"Model": "fireworks [fp8]",
|
31 |
+
"URL": "https://fireworks.ai/models/fireworks/flux-1-dev-fp8",
|
32 |
+
"GenEval": 65.55,
|
33 |
+
"HPS (v2.1)": 30.26,
|
34 |
+
"GenAI-Bench (VQA)": 0.7455,
|
35 |
+
"DrawBench (Image Reward)": 0.9467,
|
36 |
+
"PartiPromts (ARNIQA)": 0.6639,
|
37 |
+
"PartiPromts (ClipIQA)": 0.8478,
|
38 |
+
"PartiPromts (ClipScore)": 27.24,
|
39 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 5625,
|
40 |
+
"Median Inference Time": 4.66,
|
41 |
+
"Price per Image": 0.014
|
42 |
+
}
|
43 |
+
{
|
44 |
+
"Model": "Pruna [extra juiced]",
|
45 |
+
"URL": "https://replicate.com/prunaai/flux.1-juiced",
|
46 |
+
"GenEval": 69.9,
|
47 |
+
"HPS (v2.1)": 29.86,
|
48 |
+
"GenAI-Bench (VQA)": 0.7466,
|
49 |
+
"DrawBench (Image Reward)": 0.9458,
|
50 |
+
"PartiPromts (ARNIQA)": 0.6591,
|
51 |
+
"PartiPromts (ClipIQA)": 0.8887,
|
52 |
+
"PartiPromts (ClipScore)": 27.6,
|
53 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 7997,
|
54 |
+
"Median Inference Time": 2.6,
|
55 |
+
"Price per Image": 0.004
|
56 |
+
}
|
57 |
+
{
|
58 |
+
"Model": "Pruna [juiced]",
|
59 |
+
"URL": "https://replicate.com/prunaai/flux.1-juiced",
|
60 |
+
"GenEval": 68.64,
|
61 |
+
"HPS (v2.1)": 30.38,
|
62 |
+
"GenAI-Bench (VQA)": 0.7408,
|
63 |
+
"DrawBench (Image Reward)": 0.9657,
|
64 |
+
"PartiPromts (ARNIQA)": 0.6762,
|
65 |
+
"PartiPromts (ClipIQA)": 0.9014,
|
66 |
+
"PartiPromts (ClipScore)": 27.55,
|
67 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 7627,
|
68 |
+
"Median Inference Time": 3.14,
|
69 |
+
"Price per Image": 0.0048
|
70 |
+
}
|
71 |
+
{
|
72 |
+
"Model": "Pruna [lightly juiced]",
|
73 |
+
"URL": "https://replicate.com/prunaai/flux.1-lightly-juiced",
|
74 |
+
"GenEval": 69.12,
|
75 |
+
"HPS (v2.1)": 30.36,
|
76 |
+
"GenAI-Bench (VQA)": 0.7405,
|
77 |
+
"DrawBench (Image Reward)": 0.9972,
|
78 |
+
"PartiPromts (ARNIQA)": 0.6789,
|
79 |
+
"PartiPromts (ClipIQA)": 0.9031,
|
80 |
+
"PartiPromts (ClipScore)": 27.56,
|
81 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 7849,
|
82 |
+
"Median Inference Time": 3.57,
|
83 |
+
"Price per Image": 0.0054
|
84 |
+
}
|
85 |
+
{
|
86 |
+
"Model": "Replicate [go_fast]",
|
87 |
+
"URL": "https://replicate.com/black-forest-labs/flux-dev",
|
88 |
+
"GenEval": 67.41,
|
89 |
+
"HPS (v2.1)": 29.25,
|
90 |
+
"GenAI-Bench (VQA)": 0.7547,
|
91 |
+
"DrawBench (Image Reward)": 0.9282,
|
92 |
+
"PartiPromts (ARNIQA)": 0.6356,
|
93 |
+
"PartiPromts (ClipIQA)": 0.8609,
|
94 |
+
"PartiPromts (ClipScore)": 27.56,
|
95 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 4872,
|
96 |
+
"Median Inference Time": 3.38,
|
97 |
+
"Price per Image": 0.025
|
98 |
+
}
|
99 |
+
{
|
100 |
+
"Model": "Together AI",
|
101 |
+
"URL": "https://www.together.ai/models/flux-1-dev",
|
102 |
+
"GenEval": 64.61,
|
103 |
+
"HPS (v2.1)": 30.22,
|
104 |
+
"GenAI-Bench (VQA)": 0.7339,
|
105 |
+
"DrawBench (Image Reward)": 0.9463,
|
106 |
+
"PartiPromts (ARNIQA)": 0.5752,
|
107 |
+
"PartiPromts (ClipIQA)": 0.8709,
|
108 |
+
"PartiPromts (ClipScore)": 27.31,
|
109 |
+
"PartiPromts (Sharpness - Laplacian Variance)": 4501,
|
110 |
+
"Median Inference Time": 3.38,
|
111 |
+
"Price per Image": 0.025
|
112 |
+
}
|