dvilasuero HF staff commited on
Commit
611fd80
1 Parent(s): 4b6ca2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -24
app.py CHANGED
@@ -167,15 +167,6 @@ def update_dashboard(dataset_idx: int| None = None):
167
  with gr.Blocks() as demo:
168
  gr.Markdown("# Argilla Dataset Dashboard")
169
 
170
- datasets_dropdown = gr.Dropdown(label="Select your dataset")
171
- datasets_dropdown.choices = [(dataset.name, idx) for idx, dataset in enumerate(datasets)]
172
-
173
- def set_selected_dataset(dataset_idx) -> None:
174
- global selected_dataset
175
-
176
- dataset = datasets[dataset_idx]
177
- selected_dataset = dataset
178
-
179
 
180
  with gr.Row():
181
  gauge_output = gr.Plot(label="Overall Progress")
@@ -188,16 +179,11 @@ with gr.Blocks() as demo:
188
 
189
  demo.load(
190
  update_dashboard,
191
- inputs=[datasets_dropdown],
192
  outputs=[gauge_output, treemap_output, leaderboard_output],
193
  every=5,
194
  )
195
 
196
- datasets_dropdown.change(
197
- update_dashboard,
198
- inputs=[datasets_dropdown],
199
- outputs=[gauge_output, treemap_output, leaderboard_output],
200
- )
201
 
202
 
203
  if __name__ == "__main__":
@@ -343,11 +329,10 @@ def get_datasets(client: rg.Argilla) -> List[rg.Dataset]:
343
 
344
  datasets = get_datasets(client)
345
 
346
- def update_dashboard(dataset_idx: int| None = None):
347
  if dataset_idx is None:
348
  return [None, None, None]
349
 
350
- dataset = datasets[dataset_idx]
351
  progress = get_progress(dataset)
352
 
353
  gauge_chart = create_gauge_chart(progress)
@@ -379,17 +364,11 @@ with gr.Blocks() as demo:
379
 
380
  demo.load(
381
  update_dashboard,
382
- inputs=[datasets_dropdown],
383
  outputs=[gauge_output, treemap_output, leaderboard_output],
384
  every=5,
385
  )
386
 
387
- datasets_dropdown.change(
388
- update_dashboard,
389
- inputs=[datasets_dropdown],
390
- outputs=[gauge_output, treemap_output, leaderboard_output],
391
- )
392
-
393
 
394
  if __name__ == "__main__":
395
  demo.launch()
 
167
  with gr.Blocks() as demo:
168
  gr.Markdown("# Argilla Dataset Dashboard")
169
 
 
 
 
 
 
 
 
 
 
170
 
171
  with gr.Row():
172
  gauge_output = gr.Plot(label="Overall Progress")
 
179
 
180
  demo.load(
181
  update_dashboard,
182
+ inputs=[selected_dataset],
183
  outputs=[gauge_output, treemap_output, leaderboard_output],
184
  every=5,
185
  )
186
 
 
 
 
 
 
187
 
188
 
189
  if __name__ == "__main__":
 
329
 
330
  datasets = get_datasets(client)
331
 
332
+ def update_dashboard(dataset: str| None = None):
333
  if dataset_idx is None:
334
  return [None, None, None]
335
 
 
336
  progress = get_progress(dataset)
337
 
338
  gauge_chart = create_gauge_chart(progress)
 
364
 
365
  demo.load(
366
  update_dashboard,
367
+ inputs=[selected_dataset],
368
  outputs=[gauge_output, treemap_output, leaderboard_output],
369
  every=5,
370
  )
371
 
 
 
 
 
 
 
372
 
373
  if __name__ == "__main__":
374
  demo.launch()