Spaces:
Running
Running
Amber Tanaka
commited on
Add Date to table (#75)
Browse files- leaderboard_transformer.py +3 -3
- ui_components.py +4 -2
leaderboard_transformer.py
CHANGED
|
@@ -257,7 +257,7 @@ class DataTransformer:
|
|
| 257 |
# --- 3. Add Columns for Agent Openness and Tooling ---
|
| 258 |
base_cols = ["id","Agent","Submitter","LLM Base","Source"]
|
| 259 |
new_cols = ["Openness", "Agent Tooling"]
|
| 260 |
-
ending_cols = ["Logs"]
|
| 261 |
|
| 262 |
metrics_to_display = [primary_score_col, f"{primary_metric} Cost"]
|
| 263 |
for item in group_metrics:
|
|
@@ -290,7 +290,7 @@ class DataTransformer:
|
|
| 290 |
# Apply the function row-wise to create the new column
|
| 291 |
attempted_column = df_view.apply(calculate_attempted, axis=1)
|
| 292 |
# Insert the new column at a nice position (e.g., after "Date")
|
| 293 |
-
df_view.insert((cols -
|
| 294 |
else:
|
| 295 |
total_benchmarks = len(group_metrics)
|
| 296 |
def calculate_benchmarks_attempted(row):
|
|
@@ -303,7 +303,7 @@ class DataTransformer:
|
|
| 303 |
else:
|
| 304 |
return f"{count}/{total_benchmarks}"
|
| 305 |
# Insert the new column, for example, after "Date"
|
| 306 |
-
df_view.insert((cols -
|
| 307 |
|
| 308 |
# --- 4. Generate the Scatter Plot for the Primary Metric ---
|
| 309 |
plots: dict[str, go.Figure] = {}
|
|
|
|
| 257 |
# --- 3. Add Columns for Agent Openness and Tooling ---
|
| 258 |
base_cols = ["id","Agent","Submitter","LLM Base","Source"]
|
| 259 |
new_cols = ["Openness", "Agent Tooling"]
|
| 260 |
+
ending_cols = ["Date", "Logs"]
|
| 261 |
|
| 262 |
metrics_to_display = [primary_score_col, f"{primary_metric} Cost"]
|
| 263 |
for item in group_metrics:
|
|
|
|
| 290 |
# Apply the function row-wise to create the new column
|
| 291 |
attempted_column = df_view.apply(calculate_attempted, axis=1)
|
| 292 |
# Insert the new column at a nice position (e.g., after "Date")
|
| 293 |
+
df_view.insert((cols - 2), "Categories Attempted", attempted_column)
|
| 294 |
else:
|
| 295 |
total_benchmarks = len(group_metrics)
|
| 296 |
def calculate_benchmarks_attempted(row):
|
|
|
|
| 303 |
else:
|
| 304 |
return f"{count}/{total_benchmarks}"
|
| 305 |
# Insert the new column, for example, after "Date"
|
| 306 |
+
df_view.insert((cols - 2), "Benchmarks Attempted", df_view.apply(calculate_benchmarks_attempted, axis=1))
|
| 307 |
|
| 308 |
# --- 4. Generate the Scatter Plot for the Primary Metric ---
|
| 309 |
plots: dict[str, go.Figure] = {}
|
ui_components.py
CHANGED
|
@@ -588,7 +588,7 @@ def create_leaderboard_display(
|
|
| 588 |
if "Score" in col or "Cost" in col:
|
| 589 |
num_score_cost_cols += 1
|
| 590 |
dynamic_widths = [90] * num_score_cost_cols
|
| 591 |
-
fixed_end_widths = [90, 50]
|
| 592 |
# 5. Combine all the lists to create the final, fully dynamic list.
|
| 593 |
final_column_widths = fixed_start_widths + dynamic_widths + fixed_end_widths
|
| 594 |
|
|
@@ -725,6 +725,7 @@ def create_benchmark_details_display(
|
|
| 725 |
'Attempted Benchmark',
|
| 726 |
benchmark_score_col,
|
| 727 |
benchmark_cost_col,
|
|
|
|
| 728 |
'Logs'
|
| 729 |
]
|
| 730 |
for col in desired_cols_in_order:
|
|
@@ -775,7 +776,8 @@ def create_benchmark_details_display(
|
|
| 775 |
datatype=df_datatypes,
|
| 776 |
interactive=False,
|
| 777 |
wrap=True,
|
| 778 |
-
column_widths=[40, 40, 200, 150, 175, 85, 100, 100, 40],
|
|
|
|
| 779 |
elem_classes=["wrap-header-df"]
|
| 780 |
)
|
| 781 |
legend_markdown = create_legend_markdown(benchmark_name)
|
|
|
|
| 588 |
if "Score" in col or "Cost" in col:
|
| 589 |
num_score_cost_cols += 1
|
| 590 |
dynamic_widths = [90] * num_score_cost_cols
|
| 591 |
+
fixed_end_widths = [90, 100, 50]
|
| 592 |
# 5. Combine all the lists to create the final, fully dynamic list.
|
| 593 |
final_column_widths = fixed_start_widths + dynamic_widths + fixed_end_widths
|
| 594 |
|
|
|
|
| 725 |
'Attempted Benchmark',
|
| 726 |
benchmark_score_col,
|
| 727 |
benchmark_cost_col,
|
| 728 |
+
'Date',
|
| 729 |
'Logs'
|
| 730 |
]
|
| 731 |
for col in desired_cols_in_order:
|
|
|
|
| 776 |
datatype=df_datatypes,
|
| 777 |
interactive=False,
|
| 778 |
wrap=True,
|
| 779 |
+
column_widths=[40, 40, 200, 150, 175, 85, 100, 100, 80, 40],
|
| 780 |
+
show_search="search",
|
| 781 |
elem_classes=["wrap-header-df"]
|
| 782 |
)
|
| 783 |
legend_markdown = create_legend_markdown(benchmark_name)
|