Joschka Strueber commited on
Commit
0b3e7a3
·
1 Parent(s): 73afbb1

[Fix] plot axes and visibility

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 gr.Plot.update(visible=False) # Hide plot
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 gr.Plot.update(value=fig, visible=True)
37
 
38
 
39
  def validate_inputs(selected_models, selected_dataset):
@@ -74,7 +74,7 @@ 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
 
5
 
6
  def create_heatmap(selected_models, selected_dataset):
7
  if not selected_models or not selected_dataset:
8
+ return None, gr.update(visible=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, gr.update(visible=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, heatmap.visible]
78
  )
79
 
80
  # Clear button