Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -478,17 +478,6 @@ def create_leaderboard(selected_categories):
|
|
478 |
|
479 |
return df
|
480 |
|
481 |
-
first_model = next(iter(models.values()))
|
482 |
-
category_choices = list(first_model['scores'].keys())
|
483 |
-
|
484 |
-
with gr.Column(visible=True) as leaderboard_tab:
|
485 |
-
leaderboard_output = gr.DataFrame(
|
486 |
-
value=create_leaderboard(category_choices),
|
487 |
-
interactive=False,
|
488 |
-
wrap=True,
|
489 |
-
datatype=["markdown", "markdown", "markdown"] + ["markdown"] * (len(category_choices)+1) # Support markdown in all columns
|
490 |
-
)
|
491 |
-
|
492 |
def hex_to_rgba(hex_color, alpha):
|
493 |
"""Convert hex color to rgba string with given alpha value."""
|
494 |
hex_color = hex_color.lstrip('#')
|
@@ -832,14 +821,16 @@ with gr.Blocks(css=css) as demo:
|
|
832 |
initial_df = create_leaderboard(category_choices)
|
833 |
|
834 |
with gr.Row():
|
835 |
-
|
836 |
-
|
|
|
837 |
|
838 |
with gr.Row():
|
|
|
839 |
model_chooser = gr.Dropdown(choices=[""] + list(models.keys()),
|
840 |
label="Select AI System for Details",
|
841 |
value="",
|
842 |
-
interactive=True, visible=
|
843 |
model_multi_chooser = gr.Dropdown(choices=list(models.keys()),
|
844 |
label="Select AI Systems for Comparison",
|
845 |
value=[],
|
@@ -853,7 +844,8 @@ with gr.Blocks(css=css) as demo:
|
|
853 |
label="Filter Categories",
|
854 |
value=category_choices)
|
855 |
|
856 |
-
|
|
|
857 |
leaderboard_output = gr.DataFrame(
|
858 |
value=initial_df,
|
859 |
interactive=False,
|
@@ -861,15 +853,17 @@ with gr.Blocks(css=css) as demo:
|
|
861 |
datatype=["markdown", "markdown", "markdown"] + ["markdown"] * (len(category_choices)+1) # Support markdown in all columns
|
862 |
)
|
863 |
|
|
|
864 |
with gr.Column(visible=False) as category_analysis_tab:
|
865 |
# Initialize with empty plot
|
866 |
initial_plot = create_category_chart([], category_choices)
|
867 |
category_chart = gr.Plot(value=initial_plot)
|
868 |
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
|
|
873 |
|
874 |
def update_dashboard(tab, selected_models, selected_model, selected_categories):
|
875 |
# Default visibility states
|
|
|
478 |
|
479 |
return df
|
480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
def hex_to_rgba(hex_color, alpha):
|
482 |
"""Convert hex color to rgba string with given alpha value."""
|
483 |
hex_color = hex_color.lstrip('#')
|
|
|
821 |
initial_df = create_leaderboard(category_choices)
|
822 |
|
823 |
with gr.Row():
|
824 |
+
# Change tab order to put Detailed Scorecard first, Category Analysis second, and Leaderboard third
|
825 |
+
tab_selection = gr.Radio(["Detailed Scorecard", "Category Analysis", "Leaderboard"],
|
826 |
+
label="Select Tab", value="Detailed Scorecard")
|
827 |
|
828 |
with gr.Row():
|
829 |
+
# Make model_chooser visible by default since Detailed Scorecard is first tab
|
830 |
model_chooser = gr.Dropdown(choices=[""] + list(models.keys()),
|
831 |
label="Select AI System for Details",
|
832 |
value="",
|
833 |
+
interactive=True, visible=True)
|
834 |
model_multi_chooser = gr.Dropdown(choices=list(models.keys()),
|
835 |
label="Select AI Systems for Comparison",
|
836 |
value=[],
|
|
|
844 |
label="Filter Categories",
|
845 |
value=category_choices)
|
846 |
|
847 |
+
# Make leaderboard tab not visible by default
|
848 |
+
with gr.Column(visible=False) as leaderboard_tab:
|
849 |
leaderboard_output = gr.DataFrame(
|
850 |
value=initial_df,
|
851 |
interactive=False,
|
|
|
853 |
datatype=["markdown", "markdown", "markdown"] + ["markdown"] * (len(category_choices)+1) # Support markdown in all columns
|
854 |
)
|
855 |
|
856 |
+
# Make category analysis tab not visible by default
|
857 |
with gr.Column(visible=False) as category_analysis_tab:
|
858 |
# Initialize with empty plot
|
859 |
initial_plot = create_category_chart([], category_choices)
|
860 |
category_chart = gr.Plot(value=initial_plot)
|
861 |
|
862 |
+
# Make detailed scorecard tab visible by default
|
863 |
+
with gr.Column(visible=True) as detailed_scorecard_tab:
|
864 |
+
model_metadata = gr.HTML(value="Please select a model to view details.", visible=True)
|
865 |
+
all_category_cards = gr.HTML(visible=False)
|
866 |
+
total_score = gr.Markdown(visible=False)
|
867 |
|
868 |
def update_dashboard(tab, selected_models, selected_model, selected_categories):
|
869 |
# Default visibility states
|