asoria HF staff commited on
Commit
dfa9cba
1 Parent(s): 9e7becb

Close data params when generating plot

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -25,8 +25,6 @@ import gradio as gr
25
 
26
  """
27
  TODOs:
28
- - Hide params panel when generating plot
29
-
30
  - Improve DataMapPlot plot arguments
31
  - Add export button for final plot
32
  - Export and serve an interactive HTML plot?
@@ -181,6 +179,7 @@ def generate_topics(dataset, config, split, column, nested_column, plot_type):
181
  else f"⚙️ Processing partial dataset 0 of ({limit} rows)"
182
  )
183
  yield (
 
184
  gr.DataFrame(value=[], interactive=False, visible=True),
185
  gr.Plot(value=None, visible=True),
186
  gr.Label({message: rows_processed / limit}, visible=True),
@@ -283,6 +282,7 @@ def generate_topics(dataset, config, split, column, nested_column, plot_type):
283
  )
284
 
285
  yield (
 
286
  topics_info,
287
  topic_plot,
288
  gr.Label({message: progress}, visible=True),
@@ -293,6 +293,7 @@ def generate_topics(dataset, config, split, column, nested_column, plot_type):
293
  logging.info("Finished processing all data")
294
 
295
  yield (
 
296
  topics_info,
297
  topic_plot,
298
  gr.Label(
@@ -305,7 +306,8 @@ def generate_topics(dataset, config, split, column, nested_column, plot_type):
305
  with gr.Blocks() as demo:
306
  gr.Markdown("# 💠 Dataset Topic Discovery 🔭")
307
  gr.Markdown("## Select dataset and text column")
308
- with gr.Accordion("Data details", open=True):
 
309
  with gr.Row():
310
  with gr.Column(scale=3):
311
  dataset_name = HuggingfaceHubSearch(
@@ -359,6 +361,7 @@ with gr.Blocks() as demo:
359
  plot_type_radio,
360
  ],
361
  outputs=[
 
362
  topics_df,
363
  topics_plot,
364
  full_topics_generation_label,
 
25
 
26
  """
27
  TODOs:
 
 
28
  - Improve DataMapPlot plot arguments
29
  - Add export button for final plot
30
  - Export and serve an interactive HTML plot?
 
179
  else f"⚙️ Processing partial dataset 0 of ({limit} rows)"
180
  )
181
  yield (
182
+ gr.Accordion(open=False),
183
  gr.DataFrame(value=[], interactive=False, visible=True),
184
  gr.Plot(value=None, visible=True),
185
  gr.Label({message: rows_processed / limit}, visible=True),
 
282
  )
283
 
284
  yield (
285
+ gr.Accordion(open=False),
286
  topics_info,
287
  topic_plot,
288
  gr.Label({message: progress}, visible=True),
 
293
  logging.info("Finished processing all data")
294
 
295
  yield (
296
+ gr.Accordion(open=False),
297
  topics_info,
298
  topic_plot,
299
  gr.Label(
 
306
  with gr.Blocks() as demo:
307
  gr.Markdown("# 💠 Dataset Topic Discovery 🔭")
308
  gr.Markdown("## Select dataset and text column")
309
+ data_details_accordion = gr.Accordion("Data details", open=True)
310
+ with data_details_accordion:
311
  with gr.Row():
312
  with gr.Column(scale=3):
313
  dataset_name = HuggingfaceHubSearch(
 
361
  plot_type_radio,
362
  ],
363
  outputs=[
364
+ data_details_accordion,
365
  topics_df,
366
  topics_plot,
367
  full_topics_generation_label,