awacke1 commited on
Commit
f21399e
·
verified ·
1 Parent(s): 5d05809

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -63,6 +63,9 @@ async def update_configs(dataset_name: str):
63
  return [], None, {"splits": []}
64
 
65
  async def update_splits(config_name: str, state: gr.State):
 
 
 
66
  splits_for_config = sorted(set([s["split"] for s in state["splits"] if s["config"] == config_name]))
67
  dataset_name = state["splits"][0]["dataset"] if state["splits"] else None
68
  dataset = await update_dataset(splits_for_config[0], config_name, dataset_name) if splits_for_config and dataset_name else gr.DataFrame.update()
@@ -89,8 +92,8 @@ with gr.Blocks() as demo:
89
 
90
  with gr.Row():
91
  dataset_name = gr.Dropdown(label="Dataset", interactive=True, allow_custom_value=True)
92
- config = gr.Dropdown(label="Subset", interactive=True)
93
- split = gr.Dropdown(label="Split", interactive=True)
94
 
95
  with gr.Row():
96
  URLcenter = gr.Textbox(label="Dataset URL", placeholder="URL")
 
63
  return [], None, {"splits": []}
64
 
65
  async def update_splits(config_name: str, state: gr.State):
66
+ if state["splits"] is None:
67
+ return [], None, gr.DataFrame.update()
68
+
69
  splits_for_config = sorted(set([s["split"] for s in state["splits"] if s["config"] == config_name]))
70
  dataset_name = state["splits"][0]["dataset"] if state["splits"] else None
71
  dataset = await update_dataset(splits_for_config[0], config_name, dataset_name) if splits_for_config and dataset_name else gr.DataFrame.update()
 
92
 
93
  with gr.Row():
94
  dataset_name = gr.Dropdown(label="Dataset", interactive=True, allow_custom_value=True)
95
+ config = gr.Dropdown(label="Subset", interactive=True, allow_custom_value=True)
96
+ split = gr.Dropdown(label="Split", interactive=True, allow_custom_value=True)
97
 
98
  with gr.Row():
99
  URLcenter = gr.Textbox(label="Dataset URL", placeholder="URL")