pantdipendra commited on
Commit
726e8be
·
verified ·
1 Parent(s): ebac442

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -579,11 +579,11 @@ with gr.Blocks(css=".gradio-container {max-width: 1200px;}") as demo:
579
  # ======== TAB 2: Unified Distribution/Co-occurrence ========
580
  with gr.Tab("Distribution/Co-occurrence"):
581
  gr.Markdown("### Select 1 or 2 features + 1 label to see a bar chart.")
582
-
583
- # Features can be selected from the dataset's columns
584
- list_of_features = sorted(df.columns)
585
  list_of_labels = sorted(predictor.prediction_map.keys())
586
-
587
  selected_features = gr.CheckboxGroup(
588
  choices=list_of_features,
589
  label="Select 1 or 2 features"
@@ -592,10 +592,10 @@ with gr.Blocks(css=".gradio-container {max-width: 1200px;}") as demo:
592
  choices=list_of_labels,
593
  label="Label Column (e.g., YOWRCONC, YOSEEDOC, etc.)"
594
  )
595
-
596
  generate_combined_btn = gr.Button("Generate Plot")
597
  combined_output = gr.Plot()
598
-
599
  generate_combined_btn.click(
600
  fn=combined_plot,
601
  inputs=[selected_features, label_dd],
 
579
  # ======== TAB 2: Unified Distribution/Co-occurrence ========
580
  with gr.Tab("Distribution/Co-occurrence"):
581
  gr.Markdown("### Select 1 or 2 features + 1 label to see a bar chart.")
582
+
583
+ # Instead of using df.columns, we now only use the keys from input_mapping
584
+ list_of_features = sorted(input_mapping.keys())
585
  list_of_labels = sorted(predictor.prediction_map.keys())
586
+
587
  selected_features = gr.CheckboxGroup(
588
  choices=list_of_features,
589
  label="Select 1 or 2 features"
 
592
  choices=list_of_labels,
593
  label="Label Column (e.g., YOWRCONC, YOSEEDOC, etc.)"
594
  )
595
+
596
  generate_combined_btn = gr.Button("Generate Plot")
597
  combined_output = gr.Plot()
598
+
599
  generate_combined_btn.click(
600
  fn=combined_plot,
601
  inputs=[selected_features, label_dd],