mgyigit commited on
Commit
0b31888
1 Parent(s): 4106543

Update src/vis_utils.py

Browse files
Files changed (1) hide show
  1. src/vis_utils.py +7 -9
src/vis_utils.py CHANGED
@@ -247,26 +247,24 @@ def update_metric_choices(benchmark_type):
247
  return (
248
  gr.update(choices=metric_names, value=metric_names[0], visible=True),
249
  gr.update(choices=metric_names, value=metric_names[1], visible=True),
250
- gr.update(visible=False), gr.update(visible=False),
251
- gr.update(visible=False), gr.update(visible=False)
252
  )
253
  elif benchmark_type == 'function':
254
  # Show aspect and dataset type selectors for function
255
  aspect_types = benchmark_specific_metrics[benchmark_type]['aspect_types']
256
- dataset_types = benchmark_specific_metrics[benchmark_type]['dataset_types']
257
  return (
258
  gr.update(visible=False), gr.update(visible=False),
259
  gr.update(choices=aspect_types, value=aspect_types[0], visible=True),
260
- gr.update(choices=dataset_types, value=dataset_types[0], visible=True),
261
- gr.update(visible=False), gr.update(visible=False)
262
  )
263
  elif benchmark_type == 'family':
264
  # Show dataset and metric selectors for family
265
  datasets = benchmark_specific_metrics[benchmark_type]['datasets']
266
  metrics = benchmark_specific_metrics[benchmark_type]['metrics']
267
  return (
268
- gr.update(visible=False), gr.update(visible=False),
269
- gr.update(visible=False), gr.update(visible=False),
270
  gr.update(choices=datasets, value=datasets[0], visible=True),
271
  gr.update(choices=metrics, value=metrics[0], visible=True)
272
  )
@@ -275,8 +273,8 @@ def update_metric_choices(benchmark_type):
275
  metrics = benchmark_specific_metrics[benchmark_type]
276
  return (
277
  gr.update(visible=False), gr.update(visible=False),
278
- gr.update(visible=False), gr.update(visible=False),
279
  gr.update(visible=False), gr.update(choices=metrics, value=metrics[0], visible=True)
280
  )
281
 
282
- return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
 
247
  return (
248
  gr.update(choices=metric_names, value=metric_names[0], visible=True),
249
  gr.update(choices=metric_names, value=metric_names[1], visible=True),
250
+ gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
 
251
  )
252
  elif benchmark_type == 'function':
253
  # Show aspect and dataset type selectors for function
254
  aspect_types = benchmark_specific_metrics[benchmark_type]['aspect_types']
255
+ metric_types = benchmark_specific_metrics[benchmark_type]['dataset_types']
256
  return (
257
  gr.update(visible=False), gr.update(visible=False),
258
  gr.update(choices=aspect_types, value=aspect_types[0], visible=True),
259
+ gr.update(visible=False),
260
+ gr.update(choices=metric_types, value=metric_types[0], visible=True)
261
  )
262
  elif benchmark_type == 'family':
263
  # Show dataset and metric selectors for family
264
  datasets = benchmark_specific_metrics[benchmark_type]['datasets']
265
  metrics = benchmark_specific_metrics[benchmark_type]['metrics']
266
  return (
267
+ gr.update(visible=False), gr.update(visible=False), gr.update(visible=False),
 
268
  gr.update(choices=datasets, value=datasets[0], visible=True),
269
  gr.update(choices=metrics, value=metrics[0], visible=True)
270
  )
 
273
  metrics = benchmark_specific_metrics[benchmark_type]
274
  return (
275
  gr.update(visible=False), gr.update(visible=False),
276
+ gr.update(visible=False),
277
  gr.update(visible=False), gr.update(choices=metrics, value=metrics[0], visible=True)
278
  )
279
 
280
+ return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)