lbartoszcze commited on
Commit
101c356
·
verified ·
1 Parent(s): f96ec08

Show responses URLs as copyable text below grid

Browse files
Files changed (1) hide show
  1. app.py +25 -11
app.py CHANGED
@@ -262,12 +262,6 @@ MODEL_COLUMN_DEFS = [
262
  "sortable": True,
263
  "filter": True,
264
  },
265
- {
266
- "field": "sample_responses_url",
267
- "headerName": "Responses",
268
- "width": 110,
269
- "cellRenderer": "markdown",
270
- },
271
  ]
272
 
273
  # Column definitions for Methods AG Grid (paired comparisons only)
@@ -520,13 +514,22 @@ def render_tab_content(tab, n):
520
  if tab == "models":
521
  # Models leaderboard view
522
  col_defs = get_model_column_defs(df)
 
523
 
524
- # Transform sample_responses_url to clickable link text
 
525
  if len(df) > 0:
526
- df["sample_responses_url"] = df["sample_responses_url"].apply(
527
- lambda x: f"[📄 View]({x})" if pd.notna(x) and x else ""
528
- )
529
- row_data = df.to_dict("records") if len(df) > 0 else []
 
 
 
 
 
 
 
530
 
531
  return html.Div([
532
  dag.AgGrid(
@@ -546,6 +549,17 @@ def render_tab_content(tab, n):
546
  style={"height": "600px"},
547
  className="ag-theme-alpine",
548
  ),
 
 
 
 
 
 
 
 
 
 
 
549
  ])
550
 
551
  elif tab == "methods":
 
262
  "sortable": True,
263
  "filter": True,
264
  },
 
 
 
 
 
 
265
  ]
266
 
267
  # Column definitions for Methods AG Grid (paired comparisons only)
 
514
  if tab == "models":
515
  # Models leaderboard view
516
  col_defs = get_model_column_defs(df)
517
+ row_data = df.to_dict("records") if len(df) > 0 else []
518
 
519
+ # Build responses links section
520
+ responses_links = []
521
  if len(df) > 0:
522
+ for _, row in df.iterrows():
523
+ url = row.get("sample_responses_url")
524
+ if pd.notna(url) and url:
525
+ model = row.get("model", "Unknown")
526
+ responses_links.append(
527
+ html.Li([
528
+ html.Strong(model),
529
+ html.Span(": "),
530
+ html.Code(url, style={"fontSize": "0.85em", "wordBreak": "break-all"}),
531
+ ], style={"marginBottom": "5px"})
532
+ )
533
 
534
  return html.Div([
535
  dag.AgGrid(
 
549
  style={"height": "600px"},
550
  className="ag-theme-alpine",
551
  ),
552
+ # Sample responses section
553
+ html.Div([
554
+ html.H4("📄 Sample Responses", style={"marginTop": "20px", "marginBottom": "10px"}),
555
+ html.P("Copy and paste these URLs to view detailed model responses:", style={"color": "#666", "fontSize": "0.9em"}),
556
+ html.Ul(responses_links) if responses_links else html.P("No sample responses available yet.", style={"color": "#999"}),
557
+ ], style={
558
+ "backgroundColor": "#f9f9f9",
559
+ "padding": "15px",
560
+ "borderRadius": "8px",
561
+ "marginTop": "20px",
562
+ }) if responses_links else None,
563
  ])
564
 
565
  elif tab == "methods":