sasha HF staff commited on
Commit
02758b3
1 Parent(s): 404a78f

Update app.py

Browse files

trying config approach proposed by

@nateraw

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -16,8 +16,15 @@ api = HfApi()
16
  datasets = [d.id for d in api.list_datasets(filter="task_categories:text-classification", sort = "downloads", direction=-1, limit = 20)]
17
 
18
  dset = st.selectbox('Choose a dataset from the Hub', options=datasets)
 
19
 
20
- dset_split = st.selectbox('Choose a dataset split for evaluation', options=data.keys())
 
 
 
 
 
 
21
 
22
 
23
  st.markdown("### Now select up to 5 models to compare their performance:")
 
16
  datasets = [d.id for d in api.list_datasets(filter="task_categories:text-classification", sort = "downloads", direction=-1, limit = 20)]
17
 
18
  dset = st.selectbox('Choose a dataset from the Hub', options=datasets)
19
+ info = datasets.get_dataset_infos(dset)
20
 
21
+ dset_config = st.selectbox('What config do you want to use?', options=list(info))
22
+
23
+ splitlist= []
24
+ for s in info[dset_config].splits:
25
+ splitlist.append(s)
26
+
27
+ dset_split = st.selectbox('Choose a dataset split for evaluation', options=splitlist)
28
 
29
 
30
  st.markdown("### Now select up to 5 models to compare their performance:")