Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update.
Browse files- app.py +23 -26
- src/about.py +1 -0
- src/display/css_html_js.py +14 -4
app.py
CHANGED
@@ -273,21 +273,23 @@ ACCURACY_PCT = {
|
|
273 |
|
274 |
|
275 |
def build_accuracy_figure(tier: str):
|
276 |
-
"""Interactive scatter: x = release date, y = accuracy (%). Hover shows solved/total."""
|
277 |
total = TIER_TOTALS[tier]
|
278 |
fig = go.Figure()
|
279 |
|
280 |
for model in MODELS_ORDER:
|
281 |
-
date_str = MODEL_RELEASES[model]
|
282 |
-
y = ACCURACY_PCT[tier][model]
|
283 |
solved = round(y * total / 100)
|
|
|
284 |
fig.add_trace(
|
285 |
go.Scatter(
|
286 |
x=[date_str],
|
287 |
y=[y],
|
288 |
mode="markers",
|
289 |
-
name=model,
|
290 |
-
marker=dict(size=
|
|
|
291 |
hovertemplate=(
|
292 |
f"<b>{model}</b><br>"
|
293 |
"Release: %{x|%b %d, %Y}<br>"
|
@@ -298,25 +300,18 @@ def build_accuracy_figure(tier: str):
|
|
298 |
)
|
299 |
)
|
300 |
|
301 |
-
# Comfortable y-range (dynamic ceiling for readability)
|
302 |
-
max_y = max(ACCURACY_PCT[tier].values()) or 1
|
303 |
-
upper = max(1, math.ceil(max_y * 1.25))
|
304 |
-
|
305 |
fig.update_layout(
|
306 |
template="plotly_white",
|
307 |
height=420,
|
308 |
margin=dict(l=30, r=120, t=10, b=40), # extra right room for legend
|
309 |
-
xaxis=dict(
|
310 |
-
title=None,
|
311 |
-
type="date",
|
312 |
-
tickformat="%b %Y",
|
313 |
-
showgrid=True,
|
314 |
-
),
|
315 |
yaxis=dict(
|
316 |
title="Accuracy (%)",
|
317 |
-
range=[0,
|
318 |
-
|
|
|
319 |
showgrid=True,
|
|
|
320 |
),
|
321 |
legend=dict(title="Models", orientation="v", y=1, x=1.02, yanchor="top"),
|
322 |
hovermode="closest",
|
@@ -337,7 +332,7 @@ with blocks:
|
|
337 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
338 |
with gr.TabItem("FormulaOne", id=0, elem_id="landing-accuracy-tab"):
|
339 |
gr.Markdown(
|
340 |
-
"The chart below
|
341 |
elem_classes="markdown-text",
|
342 |
)
|
343 |
|
@@ -363,23 +358,25 @@ with blocks:
|
|
363 |
gr.Markdown(
|
364 |
"""
|
365 |
<div class="f1-container">
|
366 |
-
<p class="f1-p" style="font-size:0.95rem;color:var(--f1-subtle);">
|
367 |
-
|
368 |
-
We also
|
369 |
-
|
370 |
-
</p>
|
371 |
</div>
|
372 |
-
|
373 |
elem_classes="markdown-text",
|
374 |
)
|
375 |
|
376 |
# "Learn more" link to the explainer tab
|
377 |
gr.Markdown(
|
378 |
-
'<div class="f1-container"><p
|
|
|
|
|
379 |
)
|
|
|
380 |
# Existing "What is FormulaOne" tab
|
381 |
with gr.TabItem("What is FormulaOne", id=1, elem_id="what-is-tab"):
|
382 |
-
|
383 |
gr.Image(
|
384 |
"assets/banner.png",
|
385 |
show_label=False,
|
|
|
273 |
|
274 |
|
275 |
def build_accuracy_figure(tier: str):
|
276 |
+
"""Interactive scatter: x = release date (ISO str), y = accuracy (%). Hover shows solved/total."""
|
277 |
total = TIER_TOTALS[tier]
|
278 |
fig = go.Figure()
|
279 |
|
280 |
for model in MODELS_ORDER:
|
281 |
+
date_str = MODEL_RELEASES[model] # e.g., "2025-08-07"
|
282 |
+
y = ACCURACY_PCT[tier][model] # percent
|
283 |
solved = round(y * total / 100)
|
284 |
+
|
285 |
fig.add_trace(
|
286 |
go.Scatter(
|
287 |
x=[date_str],
|
288 |
y=[y],
|
289 |
mode="markers",
|
290 |
+
name=model, # distinct legend entry & color per model
|
291 |
+
marker=dict(size=8, opacity=0.55, line=dict(width=0.5)),
|
292 |
+
cliponaxis=False, # let markers render over axes
|
293 |
hovertemplate=(
|
294 |
f"<b>{model}</b><br>"
|
295 |
"Release: %{x|%b %d, %Y}<br>"
|
|
|
300 |
)
|
301 |
)
|
302 |
|
|
|
|
|
|
|
|
|
303 |
fig.update_layout(
|
304 |
template="plotly_white",
|
305 |
height=420,
|
306 |
margin=dict(l=30, r=120, t=10, b=40), # extra right room for legend
|
307 |
+
xaxis=dict(title=None, type="date", tickformat="%b %Y", showgrid=True),
|
|
|
|
|
|
|
|
|
|
|
308 |
yaxis=dict(
|
309 |
title="Accuracy (%)",
|
310 |
+
range=[0, 100], # fixed 0–100
|
311 |
+
tick0=0,
|
312 |
+
dtick=10,
|
313 |
showgrid=True,
|
314 |
+
layer="below traces", # draw axis below points so dots aren't “cut”
|
315 |
),
|
316 |
legend=dict(title="Models", orientation="v", y=1, x=1.02, yanchor="top"),
|
317 |
hovermode="closest",
|
|
|
332 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
333 |
with gr.TabItem("FormulaOne", id=0, elem_id="landing-accuracy-tab"):
|
334 |
gr.Markdown(
|
335 |
+
"The chart below summarises Frontier model performance on FormulaOne.",
|
336 |
elem_classes="markdown-text",
|
337 |
)
|
338 |
|
|
|
358 |
gr.Markdown(
|
359 |
"""
|
360 |
<div class="f1-container">
|
361 |
+
<p class="f1-p" style="font-size:0.95rem;color:var(--f1-subtle);">
|
362 |
+
All models were sampled with their highest available reasoning settings and a maximum token budget.
|
363 |
+
We also provided the models with a diverse few-shot prompt that is highly supportive for FormulaOne problems,
|
364 |
+
covering many of the subtle details of state design and maintenance, from a broad array of categories.
|
365 |
+
</p>
|
366 |
</div>
|
367 |
+
""",
|
368 |
elem_classes="markdown-text",
|
369 |
)
|
370 |
|
371 |
# "Learn more" link to the explainer tab
|
372 |
gr.Markdown(
|
373 |
+
'<div class="f1-container"><p style="font-size:1.05rem;font-weight:600;">'
|
374 |
+
'<a class="f1-a" href="#what-is-formulaone">Learn more about FormulaOne.</a>'
|
375 |
+
"</p></div>"
|
376 |
)
|
377 |
+
|
378 |
# Existing "What is FormulaOne" tab
|
379 |
with gr.TabItem("What is FormulaOne", id=1, elem_id="what-is-tab"):
|
|
|
380 |
gr.Image(
|
381 |
"assets/banner.png",
|
382 |
show_label=False,
|
src/about.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
PAPER_URL = "https://arxiv.org/abs/2507.13337"
|
3 |
|
4 |
WHAT_IS_F1_HTML_TOP = f"""
|
|
|
5 |
<div class="f1-container">
|
6 |
<header class="text-center mb-12">
|
7 |
<h1 class="text-4xl md:text-5xl font-bold text-gray-900 f1-h1">FormulaOne</h1>
|
|
|
2 |
PAPER_URL = "https://arxiv.org/abs/2507.13337"
|
3 |
|
4 |
WHAT_IS_F1_HTML_TOP = f"""
|
5 |
+
<a id="what-is-formulaone"></a>
|
6 |
<div class="f1-container">
|
7 |
<header class="text-center mb-12">
|
8 |
<h1 class="text-4xl md:text-5xl font-bold text-gray-900 f1-h1">FormulaOne</h1>
|
src/display/css_html_js.py
CHANGED
@@ -19,14 +19,24 @@ custom_css = """
|
|
19 |
#f1-examples { max-width: 710px; margin: 0 auto; }
|
20 |
|
21 |
/* NEW: landing tab width + tier selector alignment */
|
|
|
22 |
#landing-accuracy-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
#f1-tier-select .wrap {
|
26 |
display: inline-flex;
|
27 |
gap: 6px;
|
28 |
padding: 4px;
|
29 |
-
background: #ffffff;
|
30 |
border: 1px solid var(--f1-border);
|
31 |
border-radius: 999px;
|
32 |
}
|
@@ -39,7 +49,7 @@ custom_css = """
|
|
39 |
cursor: pointer;
|
40 |
}
|
41 |
#f1-tier-select input[type="radio"]:checked + span {
|
42 |
-
background: #eef2ff;
|
43 |
border-radius: 999px;
|
44 |
padding: 6px 12px;
|
45 |
box-shadow: 0 1px 2px rgba(0,0,0,0.04);
|
|
|
19 |
#f1-examples { max-width: 710px; margin: 0 auto; }
|
20 |
|
21 |
/* NEW: landing tab width + tier selector alignment */
|
22 |
+
/* Landing tab width + tier selector alignment */
|
23 |
#landing-accuracy-tab { max-width: 800px; margin-left: auto; margin-right: auto; }
|
24 |
+
|
25 |
+
/* Right-align the switcher row; transparent background & border */
|
26 |
+
#f1-tier-select-row {
|
27 |
+
justify-content: flex-end;
|
28 |
+
margin-bottom: 6px;
|
29 |
+
background: transparent !important;
|
30 |
+
border: none !important;
|
31 |
+
}
|
32 |
+
|
33 |
+
/* Make the control look like "pills" and force RTL layout */
|
34 |
+
#f1-tier-select { direction: rtl; } /* RTL direction (equivalent effect to dir="rtl") */
|
35 |
#f1-tier-select .wrap {
|
36 |
display: inline-flex;
|
37 |
gap: 6px;
|
38 |
padding: 4px;
|
39 |
+
background: #ffffff; /* white background for the switcher itself */
|
40 |
border: 1px solid var(--f1-border);
|
41 |
border-radius: 999px;
|
42 |
}
|
|
|
49 |
cursor: pointer;
|
50 |
}
|
51 |
#f1-tier-select input[type="radio"]:checked + span {
|
52 |
+
background: #eef2ff; /* only selected pill is tinted */
|
53 |
border-radius: 999px;
|
54 |
padding: 6px 12px;
|
55 |
box-shadow: 0 1px 2px rgba(0,0,0,0.04);
|