Spaces:
Running
Running

fix: update image links in the "About" section to point to relevant comparison images for improved clarity and accuracy
6feae38
import math | |
from pathlib import Path | |
import gradio as gr | |
import pandas as pd | |
from gradio_leaderboard import ColumnFilter, Leaderboard | |
abs_path = Path(__file__).parent | |
# Any pandas-compatible data | |
df = pd.read_csv(str(abs_path / "data.csv")) | |
df["Model"] = df.apply( | |
lambda row: f'<a target="_blank" href="{row["URL"]}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{row["Provider"]}</a>', | |
axis=1, | |
) | |
df = df[["Model"] + [col for col in df.columns.tolist() if col not in ["URL", "Provider", "Model"]]] | |
with gr.Blocks("ParityError/Interstellar") as demo: | |
gr.Markdown( | |
""" | |
<h1 style="margin: 0;">InfraBench - A Leaderboard for Inference Providers</h1> | |
<br> | |
<div style="margin-bottom: 20px;"> | |
<p>Welcome to InfraBench, the ultimate leaderboard for evaluating inference providers. Our platform focuses on key metrics such as cost, quality, and compression to help you make informed decisions. Whether you're a developer, researcher, or business looking to optimize your inference processes, InfraBench provides the insights you need to choose the best provider for your needs.</p> | |
</div> | |
""" | |
) | |
with gr.Tabs(): | |
with gr.TabItem("FLUX.1 [dev] Leaderboard"): | |
median_inference_time_min = math.floor(float(df["Median Inference Time (in s)"].min())) | |
median_inference_time_max = math.ceil(float(df["Median Inference Time (in s)"].max())) | |
price_per_image_min = math.floor(float(df["Price per Image"].min())) | |
price_per_image_max = math.ceil(float(df["Price per Image"].max())) | |
Leaderboard( | |
value=df, | |
search_columns=["Model"], | |
filter_columns=[ | |
ColumnFilter( | |
column="Median Inference Time (in s)", | |
type="slider", | |
default=[median_inference_time_min, median_inference_time_max], | |
min=median_inference_time_min, | |
max=median_inference_time_max, | |
), | |
ColumnFilter( | |
column="Price per Image", | |
type="slider", | |
default=[price_per_image_min, price_per_image_max], | |
min=price_per_image_min, | |
max=price_per_image_max, | |
), | |
], | |
select_columns=df.columns.tolist(), | |
datatype="markdown", | |
) | |
with gr.TabItem("About"): | |
gr.Markdown( | |
""" | |
# 💜 About Pruna AI | |
We are Pruna AI, an open source AI optimisation engine and we simply make your models cheaper, faster, smaller, greener! | |
# 📊 About InfraBench | |
InfraBench is a leaderboard for inference providers, focusing on cost, quality, and compression. | |
Over the past few years, we’ve observed outstanding progress in image generation models fueled by ever-larger architectures. | |
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. | |
While compression techniques can reduce inference time, their impact on quality often remains unclear. | |
<a href="https://huggingface.co/datasets/PrunaAI/documentation-images/resolve/main/inferbench/spider_comparison.png" target="_blank">Spider Comparison</a> | |
To bring more transparency around the quality of compressed models: | |
- We release “juiced” endpoints for popular image generation models on Replicate, making it easy to play around with our compressed models. | |
- We assess the quality of compressed FLUX-APIs from Replicate, fal, Fireworks AI and Together AI according to different benchmarks. | |
<a href="https://huggingface.co/datasets/PrunaAI/documentation-images/resolve/main/inferbench/speed_comparison.png" target="_blank">Speed Comparison</a> | |
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. | |
This combination is available in our Pruna Pro package and can be applied to almost every image generation model. | |
# 🌍 Join the Pruna AI community! | |
<p><a rel="nofollow" href="https://twitter.com/PrunaAI"><img alt="Twitter" src="https://img.shields.io/twitter/follow/PrunaAI?style=social"></a> | |
<a rel="nofollow" href="https://github.com/PrunaAI/pruna"><img alt="GitHub" src="https://img.shields.io/github/stars/prunaai/pruna"></a> | |
<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> | |
<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> | |
<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> | |
""" | |
) | |
with gr.Accordion("Citation", open=True): | |
gr.Markdown( | |
""" | |
```bibtex | |
@article{InfraBench, | |
title={InfraBench: A Leaderboard for Inference Providers}, | |
author={PrunaAI}, | |
year={2025}, | |
howpublished={\\url{https://huggingface.co/spaces/PrunaAI/InferBench}} | |
} | |
``` | |
""" | |
) | |
if __name__ == "__main__": | |
demo.launch() | |