pile-v2-eda / app.py
reshinthadith's picture
Update app.py
9fe34dd
raw
history blame
840 Bytes
import streamlit as st
import datasets
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']
st.sidebar.title('Pile v2 Explorer')
split = st.sidebar.selectbox('Select a split', splits)
st.sidebar.write('You selected:', split)
dataset = datasets.load_dataset('CarperAI/pile-v2-small-filtered', data_dir="data/"+split+"/data.json")
index = st.sidebar.slider('Select a row', 0, len(dataset['train'])-1, 0)
st.write(dataset['train'][index]['text'])