Michael Rabinovich commited on
Commit
97b9a4a
·
1 Parent(s): 0e3b21f

app: Citation + Validation Guidelines accordions, validation link in About

Browse files

Bundle 1+2 C7. Two collapsed accordions above the leaderboard
tables plus a validation-policy bullet on the About tab.

- Validation Guidelines accordion (collapsed by default, sits above
the tables). Carries the two-tier story in two lines
(unvalidated -> validated, four evidence types) plus a link to
the canonical policy doc in the main repo at
`cadgenbench/docs/benchmark/validation.md`. Bundle 4 creates the
file; the link will 404 until that lands, then resolves.
- Citation accordion (collapsed by default, below Validation
Guidelines). Carries the verbatim BibTeX entry locked in
space-setup/bundles/1-2-space-ux.md (cite key cadgenbench2026,
Space URL as howpublished). Rendered in a `gr.Code` with
language=None (no BibTeX highlighter ships with gradio) and
show_line_numbers off so the entry stays copy-paste tidy.
- About tab picks up a new bullet linking the same validation doc.

VALIDATION_DOC_URL is centralised at module level so the
Validation Guidelines markdown, the About bullet, and any future
caller stay in sync.

Verification (autonomous):

- 19/19 unit tests still green.
- Local boot probe: GET /config returns JSON containing both
accordion labels ("Citation", "Validation guidelines"), the
BibTeX cite key ("cadgenbench2026"), the validation doc URL,
and the About-tab validation bullet. Report proxy still serves
200 + text/html for a known modern row.

Live probe runs after push; will surface only on failure.

Files changed (1) hide show
  1. app.py +42 -0
app.py CHANGED
@@ -47,6 +47,14 @@ logging.basicConfig(
47
  )
48
 
49
 
 
 
 
 
 
 
 
 
50
  ABOUT_MD = f"""## About
51
 
52
  **CADGenBench** evaluates AI-driven CAD generation: how well a model can
@@ -61,8 +69,26 @@ correct 3D model.
61
  submissions and computed results in
62
  [`{HF_SUBMISSIONS_REPO}`](https://huggingface.co/datasets/{HF_SUBMISSIONS_REPO}).
63
  - **Code**: [`huggingface/cadgenbench`](https://github.com/huggingface/cadgenbench).
 
64
  """
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  DETAIL_PLACEHOLDER = "_Click a row above for details._"
67
 
68
  _ISO_TS_RE = re.compile(r"^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}):\d{2}Z$")
@@ -221,6 +247,22 @@ with gr.Blocks(title="CADGenBench Leaderboard", theme=gr.themes.Soft()) as block
221
  )
222
 
223
  with gr.Tab("Leaderboard"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  # Two stacked tables, split by `validation_status`. Validated
225
  # on top so the curated results are above the fold; unvalidated
226
  # below carries every other row (auto-published, awaiting
 
47
  )
48
 
49
 
50
+ # Canonical policy doc lives in the code repo so contributors reading
51
+ # the GitHub repo see it without needing to visit the Space. Linked
52
+ # from both the Leaderboard tab's Validation Guidelines accordion and
53
+ # the About tab.
54
+ VALIDATION_DOC_URL = (
55
+ "https://github.com/huggingface/cadgenbench/blob/main/docs/benchmark/validation.md"
56
+ )
57
+
58
  ABOUT_MD = f"""## About
59
 
60
  **CADGenBench** evaluates AI-driven CAD generation: how well a model can
 
69
  submissions and computed results in
70
  [`{HF_SUBMISSIONS_REPO}`](https://huggingface.co/datasets/{HF_SUBMISSIONS_REPO}).
71
  - **Code**: [`huggingface/cadgenbench`](https://github.com/huggingface/cadgenbench).
72
+ - **Validation policy**: [`docs/benchmark/validation.md`]({VALIDATION_DOC_URL}).
73
  """
74
 
75
+ # Verbatim BibTeX entry locked in space-setup/bundles/1-2-space-ux.md
76
+ # (Locked decisions section). Shown in the Citation accordion as a
77
+ # copy-paste handle for anyone citing this benchmark; the About tab
78
+ # already links the source code via huggingface/cadgenbench so the
79
+ # Space URL is the right deep-link target for the citation.
80
+ CITATION_BIBTEX = r"""@misc{cadgenbench2026,
81
+ author = {Rabinovich, Michael and {Hugging Face}},
82
+ title = {{CADGenBench}: a benchmark for {AI}-driven {CAD} generation},
83
+ year = {2026},
84
+ publisher = {Hugging Face},
85
+ howpublished = {\url{https://huggingface.co/spaces/HuggingAI4Engineering/cadgenbench-leaderboard}},
86
+ }"""
87
+
88
+ VALIDATION_GUIDELINES_MD = f"""Submissions appear on the **Unvalidated** table the moment evaluation completes. Maintainers promote rows to **Validated** after methodology review, accepting one of four evidence types (`code`, `traces`, `api`, `manual`).
89
+
90
+ Full policy: [`docs/benchmark/validation.md`]({VALIDATION_DOC_URL})."""
91
+
92
  DETAIL_PLACEHOLDER = "_Click a row above for details._"
93
 
94
  _ISO_TS_RE = re.compile(r"^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}):\d{2}Z$")
 
247
  )
248
 
249
  with gr.Tab("Leaderboard"):
250
+ # Collapsed accordions above the tables. Validation guidelines
251
+ # gives the short two-tier story + link to the full policy
252
+ # doc; Citation carries the verbatim BibTeX entry. Both start
253
+ # closed so the leaderboard itself stays above the fold.
254
+ with gr.Accordion("Validation guidelines", open=False):
255
+ gr.Markdown(VALIDATION_GUIDELINES_MD)
256
+ with gr.Accordion("Citation", open=False):
257
+ # language=None -> plain monospaced render (gr.Code doesn't
258
+ # ship a BibTeX highlighter); show_line_numbers off because
259
+ # the entry is meant to be copy-pasted, not annotated.
260
+ gr.Code(
261
+ value=CITATION_BIBTEX,
262
+ language=None,
263
+ show_line_numbers=False,
264
+ )
265
+
266
  # Two stacked tables, split by `validation_status`. Validated
267
  # on top so the curated results are above the fold; unvalidated
268
  # below carries every other row (auto-published, awaiting