MansiJerry Claude Sonnet 5 commited on
Commit
b425cf4
Β·
1 Parent(s): 2a3734e

Drop gradio_leaderboard, bump SDK to Gradio 6.27.0

Browse files

gradio_leaderboard is capped at gradio<6.0, and every gradio<6 release caps
Pillow<12.0 β€” incompatible with eval-unlearn's Pillow>=12.1.0 floor. No
version of gradio_leaderboard supports gradio 6.x, so it has to go rather
than be worked around. Replaced both Leaderboard components with
gr.Dataframe, plus manual search/concept-filter controls for the community
table to keep the equivalent functionality.

Verified locally against the exact pinned gradio==6.27.0 (matching what the
Space will install) with launch() stubbed: the app builds, oauth attaches,
and a full submit_model() run (stubbed GPU calls) produces a correct result
row.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +41 -16
  3. requirements.txt +0 -1
README.md CHANGED
@@ -8,7 +8,7 @@ app_file: app.py
8
  pinned: true
9
  license: mit
10
  short_description: Submit your unlearned diffusion model for live evaluation
11
- sdk_version: 5.49.1
12
  tags:
13
  - leaderboard
14
  hf_oauth: true
 
8
  pinned: true
9
  license: mit
10
  short_description: Submit your unlearned diffusion model for live evaluation
11
+ sdk_version: 6.27.0
12
  tags:
13
  - leaderboard
14
  hf_oauth: true
app.py CHANGED
@@ -1,5 +1,4 @@
1
  import gradio as gr
2
- from gradio_leaderboard import Leaderboard, SelectColumns
3
  import pandas as pd
4
 
5
  from src.evaluation.runner import (
@@ -193,6 +192,22 @@ def _log(lines):
193
  return "\n".join(lines)
194
 
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  def on_concept_change(concept):
197
  available = available_metrics_for_concept(concept)
198
  return gr.update(choices=available, value=available)
@@ -312,7 +327,7 @@ custom_css = """
312
  # -------------------------
313
  # App
314
  # -------------------------
315
- demo = gr.Blocks(css=custom_css)
316
  with demo:
317
  gr.HTML(TITLE)
318
 
@@ -322,28 +337,38 @@ with demo:
322
  gr.HTML(TABLES_HTML)
323
 
324
  gr.Markdown("### Community submissions")
325
- community_leaderboard = Leaderboard(
 
 
 
 
 
 
 
 
326
  value=load_results(),
327
  datatype=["str", "str", "str"] + ["number"] * 10 + ["str", "str"],
328
- search_columns=["Model", "Submitted by"],
329
- filter_columns=["Concept", "Status"],
330
  interactive=False,
 
 
 
 
 
 
 
 
 
 
 
 
331
  )
332
- refresh_btn = gr.Button("πŸ”„ Refresh")
333
- refresh_btn.click(fn=load_results, outputs=community_leaderboard)
334
 
335
  gr.Markdown(REFERENCE_TABLE_TEXT, elem_classes="markdown-text")
336
- Leaderboard(
337
  value=reference_df,
338
  datatype=["number", "html"] + ["number"] * 10,
339
- select_columns=SelectColumns(
340
- default_selection=["#"] + _reference_columns + ["Avg BenchScore"],
341
- cant_deselect=["#", "Technique"],
342
- label="Select Columns to Display:",
343
- ),
344
- search_columns=["Technique"],
345
- filter_columns=[],
346
  interactive=False,
 
347
  )
348
 
349
  with gr.TabItem("πŸš€ Submit a Model"):
@@ -381,4 +406,4 @@ with demo:
381
  concurrency_id="submissions",
382
  )
383
 
384
- demo.queue().launch()
 
1
  import gradio as gr
 
2
  import pandas as pd
3
 
4
  from src.evaluation.runner import (
 
192
  return "\n".join(lines)
193
 
194
 
195
+ def filter_community_results(search: str, concept_filter: str) -> pd.DataFrame:
196
+ df = load_results()
197
+ if df.empty:
198
+ return df
199
+ if search:
200
+ needle = search.lower()
201
+ mask = (
202
+ df["Model"].str.lower().str.contains(needle, na=False)
203
+ | df["Submitted by"].str.lower().str.contains(needle, na=False)
204
+ )
205
+ df = df[mask]
206
+ if concept_filter and concept_filter != "All":
207
+ df = df[df["Concept"] == concept_filter]
208
+ return df
209
+
210
+
211
  def on_concept_change(concept):
212
  available = available_metrics_for_concept(concept)
213
  return gr.update(choices=available, value=available)
 
327
  # -------------------------
328
  # App
329
  # -------------------------
330
+ demo = gr.Blocks()
331
  with demo:
332
  gr.HTML(TITLE)
333
 
 
337
  gr.HTML(TABLES_HTML)
338
 
339
  gr.Markdown("### Community submissions")
340
+ with gr.Row():
341
+ community_search = gr.Textbox(
342
+ label="Search (model or submitter)", scale=2
343
+ )
344
+ community_concept_filter = gr.Dropdown(
345
+ choices=["All"] + CONCEPTS, value="All", label="Filter by concept", scale=1
346
+ )
347
+ refresh_btn = gr.Button("πŸ”„ Refresh", scale=0)
348
+ community_leaderboard = gr.Dataframe(
349
  value=load_results(),
350
  datatype=["str", "str", "str"] + ["number"] * 10 + ["str", "str"],
 
 
351
  interactive=False,
352
+ wrap=True,
353
+ )
354
+ for control in (community_search, community_concept_filter):
355
+ control.change(
356
+ fn=filter_community_results,
357
+ inputs=[community_search, community_concept_filter],
358
+ outputs=community_leaderboard,
359
+ )
360
+ refresh_btn.click(
361
+ fn=filter_community_results,
362
+ inputs=[community_search, community_concept_filter],
363
+ outputs=community_leaderboard,
364
  )
 
 
365
 
366
  gr.Markdown(REFERENCE_TABLE_TEXT, elem_classes="markdown-text")
367
+ gr.Dataframe(
368
  value=reference_df,
369
  datatype=["number", "html"] + ["number"] * 10,
 
 
 
 
 
 
 
370
  interactive=False,
371
+ wrap=True,
372
  )
373
 
374
  with gr.TabItem("πŸš€ Submit a Model"):
 
406
  concurrency_id="submissions",
407
  )
408
 
409
+ demo.queue().launch(css=custom_css)
requirements.txt CHANGED
@@ -3,7 +3,6 @@ eval-unlearn[asr,fid,tifa]>=1.0.2
3
  datasets
4
  gradio
5
  gradio[oauth]
6
- gradio_leaderboard==0.0.13
7
  gradio_client
8
  huggingface-hub>=0.18.0
9
  matplotlib
 
3
  datasets
4
  gradio
5
  gradio[oauth]
 
6
  gradio_client
7
  huggingface-hub>=0.18.0
8
  matplotlib