Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
8ef42db
1
Parent(s): 08bced8
cleanup the plots
Browse files- analytics.py +13 -5
- app.py +4 -4
analytics.py
CHANGED
|
@@ -612,9 +612,14 @@ def _plot_company_bars(
|
|
| 612 |
text_in = [value_fmt.format(v) for v in values]
|
| 613 |
text_colors = [f"rgba(255,255,255,{a:.3f})" for a in text_alphas]
|
| 614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 615 |
fig = go.Figure(
|
| 616 |
go.Bar(
|
| 617 |
-
x=
|
| 618 |
y=values,
|
| 619 |
customdata=list(model_ids),
|
| 620 |
marker=dict(
|
|
@@ -647,6 +652,9 @@ def _plot_company_bars(
|
|
| 647 |
font=dict(size=18),
|
| 648 |
),
|
| 649 |
xaxis=dict(
|
|
|
|
|
|
|
|
|
|
| 650 |
tickangle=-40,
|
| 651 |
automargin=True,
|
| 652 |
showgrid=False,
|
|
@@ -666,12 +674,12 @@ def _plot_company_bars(
|
|
| 666 |
return fig
|
| 667 |
|
| 668 |
|
| 669 |
-
def
|
| 670 |
df: pd.DataFrame,
|
| 671 |
top_n: int = 10,
|
| 672 |
) -> go.Figure:
|
| 673 |
"""
|
| 674 |
-
Ranked vertical bars of the far-field
|
| 675 |
|
| 676 |
Mirrors the Artificial Analysis style: top models sorted descending, value
|
| 677 |
inside the bar, rounded corners, one color per HF org.
|
|
@@ -692,7 +700,7 @@ def plot_intelligence_bars(
|
|
| 692 |
labels=labels,
|
| 693 |
values=[float(v) for v in d["ff_score"].tolist()],
|
| 694 |
model_ids=d["model_id"].tolist(),
|
| 695 |
-
title="
|
| 696 |
subtitle="Far-field accuracy score · Higher is better",
|
| 697 |
value_fmt="{:.0f}",
|
| 698 |
hover_value_fmt="%{y:.2f} / 100",
|
|
@@ -707,7 +715,7 @@ def plot_speed_bars(
|
|
| 707 |
"""
|
| 708 |
Ranked vertical bars of throughput (`eval_rtf`, × realtime).
|
| 709 |
|
| 710 |
-
Companion to `
|
| 711 |
same in-bar value labels, rounded corners.
|
| 712 |
"""
|
| 713 |
if df.empty or "eval_rtf" not in df.columns:
|
|
|
|
| 612 |
text_in = [value_fmt.format(v) for v in values]
|
| 613 |
text_colors = [f"rgba(255,255,255,{a:.3f})" for a in text_alphas]
|
| 614 |
|
| 615 |
+
# Use integer x-positions so duplicate display labels (e.g. two models that
|
| 616 |
+
# share the same truncated short name) don't collapse into a single stacked
|
| 617 |
+
# bar. Tick labels are mapped back onto these positions below.
|
| 618 |
+
x_positions = list(range(len(labels)))
|
| 619 |
+
|
| 620 |
fig = go.Figure(
|
| 621 |
go.Bar(
|
| 622 |
+
x=x_positions,
|
| 623 |
y=values,
|
| 624 |
customdata=list(model_ids),
|
| 625 |
marker=dict(
|
|
|
|
| 652 |
font=dict(size=18),
|
| 653 |
),
|
| 654 |
xaxis=dict(
|
| 655 |
+
tickmode="array",
|
| 656 |
+
tickvals=x_positions,
|
| 657 |
+
ticktext=list(labels),
|
| 658 |
tickangle=-40,
|
| 659 |
automargin=True,
|
| 660 |
showgrid=False,
|
|
|
|
| 674 |
return fig
|
| 675 |
|
| 676 |
|
| 677 |
+
def plot_accuracy_bars(
|
| 678 |
df: pd.DataFrame,
|
| 679 |
top_n: int = 10,
|
| 680 |
) -> go.Figure:
|
| 681 |
"""
|
| 682 |
+
Ranked vertical bars of the far-field accuracy score (`ff_score`).
|
| 683 |
|
| 684 |
Mirrors the Artificial Analysis style: top models sorted descending, value
|
| 685 |
inside the bar, rounded corners, one color per HF org.
|
|
|
|
| 700 |
labels=labels,
|
| 701 |
values=[float(v) for v in d["ff_score"].tolist()],
|
| 702 |
model_ids=d["model_id"].tolist(),
|
| 703 |
+
title="Accuracy",
|
| 704 |
subtitle="Far-field accuracy score · Higher is better",
|
| 705 |
value_fmt="{:.0f}",
|
| 706 |
hover_value_fmt="%{y:.2f} / 100",
|
|
|
|
| 715 |
"""
|
| 716 |
Ranked vertical bars of throughput (`eval_rtf`, × realtime).
|
| 717 |
|
| 718 |
+
Companion to `plot_accuracy_bars`: same color-per-company convention,
|
| 719 |
same in-bar value labels, rounded corners.
|
| 720 |
"""
|
| 721 |
if df.empty or "eval_rtf" not in df.columns:
|
app.py
CHANGED
|
@@ -288,7 +288,7 @@ def _analytics_initial():
|
|
| 288 |
line_default = [k for k in live_keys if k in avail] or list(avail)
|
| 289 |
sel = ids[: min(5, len(ids))]
|
| 290 |
tn = 10
|
| 291 |
-
fig_intel = analytics.
|
| 292 |
fig_speed = analytics.plot_speed_bars(df, top_n=tn)
|
| 293 |
fig_hm = analytics.plot_scenario_heatmap(df, line_default, top_n=tn)
|
| 294 |
fig_pareto = analytics.plot_pareto_frontier(df)
|
|
@@ -318,7 +318,7 @@ def _analytics_apply(models, line_keys, top_n):
|
|
| 318 |
if not lk:
|
| 319 |
lk = avail
|
| 320 |
tn = int(top_n) if top_n else 10
|
| 321 |
-
fig_intel = analytics.
|
| 322 |
fig_speed = analytics.plot_speed_bars(df, top_n=tn)
|
| 323 |
fig_hm = analytics.plot_scenario_heatmap(df, lk, top_n=tn)
|
| 324 |
fig_pareto = analytics.plot_pareto_frontier(df)
|
|
@@ -811,7 +811,7 @@ with gr.Blocks(title=APP_TITLE, theme=_theme, css=LEADERBOARD_CSS) as demo:
|
|
| 811 |
gr.Markdown(
|
| 812 |
"Charts support standard Plotly interaction (legend, zoom, pan, hover).\n\n"
|
| 813 |
"**Leaderboard order** is by **Average WER** (mean across populated live scenarios; lower is better).\n\n"
|
| 814 |
-
"**
|
| 815 |
"**Speed** ranks the top N models by RTFx (audio sec / inference sec, higher is better). "
|
| 816 |
"Bars are colored per company (e.g. all NVIDIA models share one color).\n\n"
|
| 817 |
"**WER heatmap** shows WER (%) by model and scenario for the top N models (sorted by Average WER); "
|
|
@@ -846,7 +846,7 @@ with gr.Blocks(title=APP_TITLE, theme=_theme, css=LEADERBOARD_CSS) as demo:
|
|
| 846 |
)
|
| 847 |
an_apply = gr.Button("Apply / refresh charts", variant="primary")
|
| 848 |
with gr.Row():
|
| 849 |
-
an_plot_intelligence = gr.Plot(label="
|
| 850 |
an_plot_speed = gr.Plot(label="Speed")
|
| 851 |
an_plot_compare = gr.Plot(label="WER heatmap")
|
| 852 |
gr.Markdown(
|
|
|
|
| 288 |
line_default = [k for k in live_keys if k in avail] or list(avail)
|
| 289 |
sel = ids[: min(5, len(ids))]
|
| 290 |
tn = 10
|
| 291 |
+
fig_intel = analytics.plot_accuracy_bars(df, top_n=tn)
|
| 292 |
fig_speed = analytics.plot_speed_bars(df, top_n=tn)
|
| 293 |
fig_hm = analytics.plot_scenario_heatmap(df, line_default, top_n=tn)
|
| 294 |
fig_pareto = analytics.plot_pareto_frontier(df)
|
|
|
|
| 318 |
if not lk:
|
| 319 |
lk = avail
|
| 320 |
tn = int(top_n) if top_n else 10
|
| 321 |
+
fig_intel = analytics.plot_accuracy_bars(df, top_n=tn)
|
| 322 |
fig_speed = analytics.plot_speed_bars(df, top_n=tn)
|
| 323 |
fig_hm = analytics.plot_scenario_heatmap(df, lk, top_n=tn)
|
| 324 |
fig_pareto = analytics.plot_pareto_frontier(df)
|
|
|
|
| 811 |
gr.Markdown(
|
| 812 |
"Charts support standard Plotly interaction (legend, zoom, pan, hover).\n\n"
|
| 813 |
"**Leaderboard order** is by **Average WER** (mean across populated live scenarios; lower is better).\n\n"
|
| 814 |
+
"**Accuracy** ranks the top N models by far-field score (WER-only FFAS, higher is better). "
|
| 815 |
"**Speed** ranks the top N models by RTFx (audio sec / inference sec, higher is better). "
|
| 816 |
"Bars are colored per company (e.g. all NVIDIA models share one color).\n\n"
|
| 817 |
"**WER heatmap** shows WER (%) by model and scenario for the top N models (sorted by Average WER); "
|
|
|
|
| 846 |
)
|
| 847 |
an_apply = gr.Button("Apply / refresh charts", variant="primary")
|
| 848 |
with gr.Row():
|
| 849 |
+
an_plot_intelligence = gr.Plot(label="Accuracy")
|
| 850 |
an_plot_speed = gr.Plot(label="Speed")
|
| 851 |
an_plot_compare = gr.Plot(label="WER heatmap")
|
| 852 |
gr.Markdown(
|