reshinthadith commited on
Commit
fe813bd
1 Parent(s): a4b7ec2

Adding else block to skip

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -11,7 +11,7 @@ contribution_json = "contributors.json"
11
  contribution_dict = json.load(open(contribution_json,"r"))
12
 
13
 
14
- splits = ['EuroParliamentProceedings', 'TED2020', 'PileOfLaw', 'StackExchange_ver2', 'GithubIssues', 'Opensubtitles', 'USPTO', 'S2ORC', 'DevDocs', 'CodePileReddit2022', 'DMMath', 'Gutenberg', 'USENET', 'GithubDiff', 'Enwiki', 'GNOME', 'ASFPublicMail', 'PileV2Reddit2020', 'CodePilePosts', 'Discourse', 'Tanzil', 'arXiv', 'UbuntuIRC', 'PubMed', 'CodePileReddit2020', 'CodePileReddit2021', 'GlobalVoices', 'FreeLaw_Options', 'PileV2Posts','Bible']
15
 
16
  cached_ds = os.listdir(CACHE_DIR)
17
  tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b')
@@ -26,7 +26,10 @@ def load_page(split):
26
  print("Sucessfully loaded "+split)
27
  st.title("Dataset Explorer")
28
  st.write(f"# {split}")
29
- st.caption(f"Contributors: {','.join(contribution_dict[split])}")
 
 
 
30
  with st.form("dataset_form"):
31
  index = st.slider('Select a row', 0, len(ds)-1, 0)
32
  if st.form_submit_button("Load"):
@@ -46,12 +49,4 @@ def load_page(split):
46
 
47
 
48
  demo_name = st.sidebar.selectbox("Choose a demo", splits)
49
- load_page(demo_name)
50
- # st.write(f"Loaded {ds} with {len(dataset['train'])} rows")
51
-
52
- # st.sidebar.title('Pile v2 Explorer')
53
- # split = st.sidebar.selectbox('Select a split', splits)
54
- # st.sidebar.write('You selected:', split)
55
- # dataset = datasets.load_dataset('CarperAI/pile-v2-small-filtered', data_dir="data/"+split+"/data.json")
56
- # index = st.sidebar.slider('Select a row', 0, len(dataset['train'])-1, 0)
57
- # st.write(dataset['train'][index]['text'])
 
11
  contribution_dict = json.load(open(contribution_json,"r"))
12
 
13
 
14
+ splits = os.listdir(CACHE_DIR)#['EuroParliamentProceedings', 'TED2020', 'PileOfLaw', 'StackExchange_ver2', 'GithubIssues', 'Opensubtitles', 'USPTO', 'S2ORC', 'DevDocs', 'CodePileReddit2022', 'DMMath', 'Gutenberg', 'USENET', 'GithubDiff', 'Enwiki', 'GNOME', 'ASFPublicMail', 'PileV2Reddit2020', 'CodePilePosts', 'Discourse', 'Tanzil', 'arXiv', 'UbuntuIRC', 'PubMed', 'CodePileReddit2020', 'CodePileReddit2021', 'GlobalVoices', 'FreeLaw_Options', 'PileV2Posts','Bible']
15
 
16
  cached_ds = os.listdir(CACHE_DIR)
17
  tokenizer = AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b')
 
26
  print("Sucessfully loaded "+split)
27
  st.title("Dataset Explorer")
28
  st.write(f"# {split}")
29
+ if split in contribution_dict:
30
+ st.caption(f"Contributors: {','.join(contribution_dict[split])}")
31
+ else:
32
+ st.caption(f"Needs to be updated....")
33
  with st.form("dataset_form"):
34
  index = st.slider('Select a row', 0, len(ds)-1, 0)
35
  if st.form_submit_button("Load"):
 
49
 
50
 
51
  demo_name = st.sidebar.selectbox("Choose a demo", splits)
52
+ load_page(demo_name)