fzarnecki commited on
Commit
ac73434
·
1 Parent(s): 338aeb2

Display fix

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -445,7 +445,7 @@ def initialize_all_components(graph_year_selector_value):
445
 
446
  leaderboard, line_plot = update_dashboard(graph_year_selector_value, random_graph_models)
447
 
448
- # Initialize model comparison
449
  if len(all_models) >= 2:
450
  random_models = random.sample(all_models, 2)
451
  model1 = random_models[0]
@@ -457,7 +457,9 @@ def initialize_all_components(graph_year_selector_value):
457
  model1 = None
458
  model2 = None
459
 
 
460
  plot1 = create_faithfulness_plot(model1) if model1 else go.Figure()
 
461
 
462
  return (
463
  gr.update(value=random_graph_models), # graph_model_filter
@@ -466,10 +468,10 @@ def initialize_all_components(graph_year_selector_value):
466
  gr.update(value=model1), # model_dropdown_1
467
  gr.update(value=model2), # model_dropdown_2
468
  plot1, # comparison_plot_1
469
- go.Figure(), # comparison_plot_2
470
  gr.update(visible=True), # col_plot_1
471
- gr.update(visible=False), # col_model_2
472
- gr.update(visible=False) # col_plot_2
473
  )
474
 
475
 
@@ -677,7 +679,7 @@ with gr.Blocks(theme=theme, css=custom_css, js=js_func) as demo:
677
  with gr.Row():
678
  split_checkbox = gr.Checkbox(
679
  label="Split into 2 segments",
680
- value=False,
681
  info="Enable to compare two models side by side"
682
  )
683
 
 
445
 
446
  leaderboard, line_plot = update_dashboard(graph_year_selector_value, random_graph_models)
447
 
448
+ # Initialize model comparison with 2 graphs side by side (split_enabled=True)
449
  if len(all_models) >= 2:
450
  random_models = random.sample(all_models, 2)
451
  model1 = random_models[0]
 
457
  model1 = None
458
  model2 = None
459
 
460
+ # Generate both plots for split view
461
  plot1 = create_faithfulness_plot(model1) if model1 else go.Figure()
462
+ plot2 = create_faithfulness_plot(model2) if model2 else go.Figure()
463
 
464
  return (
465
  gr.update(value=random_graph_models), # graph_model_filter
 
468
  gr.update(value=model1), # model_dropdown_1
469
  gr.update(value=model2), # model_dropdown_2
470
  plot1, # comparison_plot_1
471
+ plot2, # comparison_plot_2 (now showing model2)
472
  gr.update(visible=True), # col_plot_1
473
+ gr.update(visible=True), # col_model_2 (now visible)
474
+ gr.update(visible=True) # col_plot_2 (now visible)
475
  )
476
 
477
 
 
679
  with gr.Row():
680
  split_checkbox = gr.Checkbox(
681
  label="Split into 2 segments",
682
+ value=True,
683
  info="Enable to compare two models side by side"
684
  )
685