Amit Kumar
commited on
Commit
Β·
f83ddbf
1
Parent(s):
7b6c7f6
added another model andmed42 and changed df style
Browse files- app.py +58 -25
- leaderboard_files/leaderboard_data.csv +8 -7
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def load_description(DESCRIPTION_FILE):
|
|
| 15 |
md_text = f.read()
|
| 16 |
html_description = markdown.markdown(md_text, extensions=["tables"])
|
| 17 |
return html_description
|
| 18 |
-
columns_fixed = ["Model Name", "Average Label", "Average Record"]
|
| 19 |
|
| 20 |
df = load_leaderboard()
|
| 21 |
all_columns = list(df.columns)
|
|
@@ -56,7 +56,7 @@ with gr.Blocks() as demo:
|
|
| 56 |
gr.HTML("<h1 style='text-align: center;'>π Medical Classification Leaderboard - Beta</h1>")
|
| 57 |
gr.Image("./about/linguist.png", elem_id="linguist-image", show_label=False)
|
| 58 |
|
| 59 |
-
# Add CSS to
|
| 60 |
demo.css = """
|
| 61 |
#linguist-image img {
|
| 62 |
max-width: 300px;
|
|
@@ -64,42 +64,75 @@ with gr.Blocks() as demo:
|
|
| 64 |
margin: 0 auto;
|
| 65 |
display: block;
|
| 66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
"""
|
| 68 |
|
| 69 |
gr.HTML(load_description(DESCRIPTION_FILE))
|
| 70 |
|
| 71 |
-
|
| 72 |
with gr.Row():
|
| 73 |
-
# dataset_filter = gr.Dropdown(label="π Select Benchmark Dataset", choices=dataset_options, value="All")
|
| 74 |
with gr.Column():
|
| 75 |
-
# list all columns here except model name and average
|
| 76 |
column_selector_data = gr.CheckboxGroup(label="π Select Columns to Display - Dataset", choices=["Chexpert Plus", "CT Rate"], value=["Chexpert Plus", "CT Rate"])
|
| 77 |
|
| 78 |
with gr.Column():
|
| 79 |
-
# first list columns of different shots
|
| 80 |
shot_filter = gr.CheckboxGroup(label="Select Shot Type", choices=shot_options, value=shot_options)
|
| 81 |
-
|
| 82 |
-
param_filter = gr.CheckboxGroup(choices=parameter_options, label="Filter by Parameter Count", value = parameter_options)
|
| 83 |
-
# rest to be added
|
| 84 |
-
# data_type_filter = gr.CheckboxGroup(choices=data_types, label="Filter by Data Type")
|
| 85 |
-
|
| 86 |
|
| 87 |
initial_data = filter_leaderboard(parameter_options, shot_options, ["Chexpert Plus", "CT Rate"])
|
| 88 |
leaderboard_table = gr.Dataframe(value=initial_data, label="π
Leaderboard", interactive=False)
|
| 89 |
-
# Initialize table
|
| 90 |
-
|
| 91 |
-
# dataset_filter.change(
|
| 92 |
-
# fn=update_leaderboard,
|
| 93 |
-
# inputs=[column_selector, dataset_filter],
|
| 94 |
-
# outputs=leaderboard_table
|
| 95 |
-
# )
|
| 96 |
-
# Trigger update
|
| 97 |
-
column_selector_data.change(filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data,], outputs=leaderboard_table)
|
| 98 |
-
|
| 99 |
-
# data_type_filter.change(filter_leaderboard, inputs=[column_selector, [], param_filter], outputs=leaderboard_table)
|
| 100 |
-
param_filter.change(fn=filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data,], outputs=leaderboard_table)
|
| 101 |
-
shot_filter.change(fn=filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data,], outputs=leaderboard_table)
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
demo.launch()
|
|
|
|
| 15 |
md_text = f.read()
|
| 16 |
html_description = markdown.markdown(md_text, extensions=["tables"])
|
| 17 |
return html_description
|
| 18 |
+
columns_fixed = ["Model Name", "Parameters", "Average Label", "Average Record"]
|
| 19 |
|
| 20 |
df = load_leaderboard()
|
| 21 |
all_columns = list(df.columns)
|
|
|
|
| 56 |
gr.HTML("<h1 style='text-align: center;'>π Medical Classification Leaderboard - Beta</h1>")
|
| 57 |
gr.Image("./about/linguist.png", elem_id="linguist-image", show_label=False)
|
| 58 |
|
| 59 |
+
# Add CSS to style the leaderboard table
|
| 60 |
demo.css = """
|
| 61 |
#linguist-image img {
|
| 62 |
max-width: 300px;
|
|
|
|
| 64 |
margin: 0 auto;
|
| 65 |
display: block;
|
| 66 |
}
|
| 67 |
+
|
| 68 |
+
/* Style the leaderboard label */
|
| 69 |
+
label[for*="leaderboard_table"] {
|
| 70 |
+
font-size: 24px;
|
| 71 |
+
font-weight: bold;
|
| 72 |
+
color: #2c3e50;
|
| 73 |
+
text-align: center;
|
| 74 |
+
margin-bottom: 10px;
|
| 75 |
+
display: block;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/* Table headers */
|
| 79 |
+
.dataframe thead th {
|
| 80 |
+
background-color: #4CAF50;
|
| 81 |
+
color: white;
|
| 82 |
+
font-size: 16px;
|
| 83 |
+
font-weight: bold;
|
| 84 |
+
padding: 12px;
|
| 85 |
+
text-align: left;
|
| 86 |
+
border-bottom: 2px solid #ccc;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/* Table cells */
|
| 90 |
+
.dataframe tbody td {
|
| 91 |
+
font-size: 14px;
|
| 92 |
+
padding: 10px 15px; /* Add horizontal spacing */
|
| 93 |
+
color: #333;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/* First and second columns spacing */
|
| 97 |
+
.dataframe tbody td:first-child,
|
| 98 |
+
.dataframe tbody td:nth-child(2) {
|
| 99 |
+
padding-left: 20px;
|
| 100 |
+
padding-right: 20px;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
/* Zebra striping */
|
| 104 |
+
.dataframe tbody tr:nth-child(even) {
|
| 105 |
+
background-color: #f9f9f9;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
/* Add hover effect */
|
| 109 |
+
.dataframe tbody tr:hover {
|
| 110 |
+
background-color: #e6f7ff;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/* Make sure the table is not squished */
|
| 114 |
+
.dataframe {
|
| 115 |
+
table-layout: auto;
|
| 116 |
+
width: 100%;
|
| 117 |
+
border-collapse: collapse;
|
| 118 |
+
}
|
| 119 |
"""
|
| 120 |
|
| 121 |
gr.HTML(load_description(DESCRIPTION_FILE))
|
| 122 |
|
|
|
|
| 123 |
with gr.Row():
|
|
|
|
| 124 |
with gr.Column():
|
|
|
|
| 125 |
column_selector_data = gr.CheckboxGroup(label="π Select Columns to Display - Dataset", choices=["Chexpert Plus", "CT Rate"], value=["Chexpert Plus", "CT Rate"])
|
| 126 |
|
| 127 |
with gr.Column():
|
|
|
|
| 128 |
shot_filter = gr.CheckboxGroup(label="Select Shot Type", choices=shot_options, value=shot_options)
|
| 129 |
+
param_filter = gr.CheckboxGroup(choices=parameter_options, label="Filter by Parameter Count", value=parameter_options)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
initial_data = filter_leaderboard(parameter_options, shot_options, ["Chexpert Plus", "CT Rate"])
|
| 132 |
leaderboard_table = gr.Dataframe(value=initial_data, label="π
Leaderboard", interactive=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
+
column_selector_data.change(filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data], outputs=leaderboard_table)
|
| 135 |
+
param_filter.change(fn=filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data], outputs=leaderboard_table)
|
| 136 |
+
shot_filter.change(fn=filter_leaderboard, inputs=[param_filter, shot_filter, column_selector_data], outputs=leaderboard_table)
|
| 137 |
|
| 138 |
demo.launch()
|
leaderboard_files/leaderboard_data.csv
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
Model Name,Parameters,Average Label,Average Record,CT Rate 0 Shot Label,CT Rate 0 Shot Record,CT Rate 1 Shot Label,CT Rate 1 Shot Record,CT Rate 5 Shots Label,CT Rate 5 Shots Record,Chexpert Plus 0 Shot Label,Chexpert Plus 0 Shot Record,Chexpert Plus 1 Shot Label,Chexpert Plus 1 Shot Record,Chexpert Plus 5 Shots Label,Chexpert Plus 5 Shots Record
|
| 2 |
-
LLama 3.1,8B,0.
|
| 3 |
-
Deepseek llama 3.1,8B,0.
|
| 4 |
-
Qwen 2.5,7B,0.
|
| 5 |
-
Qwen 2.5,14B,0.818,0.
|
| 6 |
-
Qwen 2.5,32B,0.
|
| 7 |
-
Gemma 2,9B,0.
|
| 8 |
-
Gemma 2,27B,0.
|
|
|
|
|
|
| 1 |
Model Name,Parameters,Average Label,Average Record,CT Rate 0 Shot Label,CT Rate 0 Shot Record,CT Rate 1 Shot Label,CT Rate 1 Shot Record,CT Rate 5 Shots Label,CT Rate 5 Shots Record,Chexpert Plus 0 Shot Label,Chexpert Plus 0 Shot Record,Chexpert Plus 1 Shot Label,Chexpert Plus 1 Shot Record,Chexpert Plus 5 Shots Label,Chexpert Plus 5 Shots Record
|
| 2 |
+
LLama 3.1,8B,0.8744,0.2386,0.9534,0.4965,0.9376,0.363,,,0.7857,0.0749,0.8365,0.0963,0.8586,0.1622
|
| 3 |
+
Deepseek llama 3.1,8B,0.7841,0.1817,0.9391,0.4722,0.8983,0.2377,,,0.5286,0.04,0.7684,0.0699,0.7861,0.0889
|
| 4 |
+
Qwen 2.5,7B,0.7514,0.2376,0.9486,0.4797,0.9523,0.4774,,,0.2125,0.0,0.8085,0.1195,0.8349,0.1113
|
| 5 |
+
Qwen 2.5,14B,0.818,0.2838,0.9609,0.5459,0.9573,0.5163,,,0.4354,0.0228,0.8607,0.1677,0.8757,0.1661
|
| 6 |
+
Qwen 2.5,32B,0.828,0.2943,0.9618,0.55,0.9569,0.5145,,,0.5125,0.0,0.8153,0.1309,0.8933,0.2759
|
| 7 |
+
Gemma 2,9B,0.8613,0.2536,0.9429,0.4712,0.9457,0.4369,,,0.7042,0.0726,0.8498,0.1121,0.8637,0.175
|
| 8 |
+
Gemma 2,27B,0.8254,0.2526,0.9506,0.4828,0.9583,0.5698,,,0.5916,0.0161,0.7673,0.0417,0.8592,0.1524
|
| 9 |
+
Med42 Llama 3.1,8B,0.8658,0.2756,0.9513,0.546,0.9353,0.432,,,0.7338,0.0752,0.8619,0.166,0.8468,0.1589
|