Spaces:
Build error
Build error
reshinthadith
commited on
Commit
·
d063ce5
1
Parent(s):
9587a68
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import datasets
|
3 |
+
|
4 |
+
splits = ['Bible', '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']
|
5 |
+
|
6 |
+
|
7 |
+
st.sidebar.title('Pile v2 Explorer')
|
8 |
+
split = st.sidebar.selectbox('Select a split', splits)
|
9 |
+
st.sidebar.write('You selected:', split)
|
10 |
+
dataset = datasets.load_dataset('CarperAI/pile-v2-small-filtered', data_dir=split,use_auth_token=True)
|
11 |
+
index = st.sidebar.slider('Select a row', 0, len(dataset['train'])-1, 0)
|
12 |
+
st.write(dataset['train'][index]['text'])
|