Spaces:
Running
Running
Joschka Strueber
commited on
Commit
·
b9eaf09
1
Parent(s):
0b3e7a3
[Fix] plot axes and visibility
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from src.dataloading import get_leaderboard_models_cached, get_leaderboard_datas
|
|
5 |
|
6 |
def create_heatmap(selected_models, selected_dataset):
|
7 |
if not selected_models or not selected_dataset:
|
8 |
-
return None,
|
9 |
|
10 |
# Generate random similarity matrix
|
11 |
size = len(selected_models)
|
@@ -33,7 +33,7 @@ def create_heatmap(selected_models, selected_dataset):
|
|
33 |
margin=dict(b=100, l=100) # Add bottom/left margin for labels
|
34 |
)
|
35 |
|
36 |
-
return fig,
|
37 |
|
38 |
|
39 |
def validate_inputs(selected_models, selected_dataset):
|
@@ -74,14 +74,14 @@ with gr.Blocks(title="LLM Similarity Analyzer") as demo:
|
|
74 |
).then(
|
75 |
fn=create_heatmap,
|
76 |
inputs=[model_dropdown, dataset_dropdown],
|
77 |
-
outputs=[heatmap,
|
78 |
)
|
79 |
|
80 |
# Clear button
|
81 |
clear_btn = gr.Button("Clear Selection")
|
82 |
clear_btn.click(
|
83 |
lambda: [None, None, None],
|
84 |
-
outputs=[model_dropdown, dataset_dropdown, heatmap]
|
85 |
)
|
86 |
|
87 |
if __name__ == "__main__":
|
|
|
5 |
|
6 |
def create_heatmap(selected_models, selected_dataset):
|
7 |
if not selected_models or not selected_dataset:
|
8 |
+
return None, False # Hide plot
|
9 |
|
10 |
# Generate random similarity matrix
|
11 |
size = len(selected_models)
|
|
|
33 |
margin=dict(b=100, l=100) # Add bottom/left margin for labels
|
34 |
)
|
35 |
|
36 |
+
return fig, True
|
37 |
|
38 |
|
39 |
def validate_inputs(selected_models, selected_dataset):
|
|
|
74 |
).then(
|
75 |
fn=create_heatmap,
|
76 |
inputs=[model_dropdown, dataset_dropdown],
|
77 |
+
outputs=[heatmap, gr.update(visible=True)]
|
78 |
)
|
79 |
|
80 |
# Clear button
|
81 |
clear_btn = gr.Button("Clear Selection")
|
82 |
clear_btn.click(
|
83 |
lambda: [None, None, None],
|
84 |
+
outputs=[model_dropdown, dataset_dropdown, heatmap, gr.update(visible=False)]
|
85 |
)
|
86 |
|
87 |
if __name__ == "__main__":
|