ricardo-lsantos commited on
Commit
bdc94bf
·
1 Parent(s): e3d53d0

added a button for loading the dataset

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,16 +1,22 @@
1
  import streamlit as st
2
  from datasets import load_dataset, Audio
3
 
4
- def app():
5
- st.title('Home')
6
- st.write('Welcome to the home page')
7
  ds_ckpt = st.text_input('Enter the dataset checkpoint', 'PolyAI/minds14')
8
  ds_lang = st.text_input('Enter the dataset language', 'en-US')
9
  ds_split = st.text_input('Enter the dataset split', 'train')
10
  # Load the dataset
11
- dataset = load_dataset(ds_ckpt, ds_lang, split=ds_split, trust_remote_code=True)
12
  # Display the dataset
13
  st.dataframe(dataset.to_pandas())
14
 
 
 
 
 
 
 
15
  if __name__ == '__main__':
16
  app()
 
1
  import streamlit as st
2
  from datasets import load_dataset, Audio
3
 
4
+ @st.cache_resource(allow_output_mutation=True)
5
+ def load_dataset_btn():
6
+ st.title('Load Dataset')
7
  ds_ckpt = st.text_input('Enter the dataset checkpoint', 'PolyAI/minds14')
8
  ds_lang = st.text_input('Enter the dataset language', 'en-US')
9
  ds_split = st.text_input('Enter the dataset split', 'train')
10
  # Load the dataset
11
+ dataset = load_dataset(ds_ckpt, ds_lang, split=ds_split)
12
  # Display the dataset
13
  st.dataframe(dataset.to_pandas())
14
 
15
+ def app():
16
+ st.title('Home')
17
+ st.write('Welcome to the home page')
18
+ if st.button('Load Dataset'):
19
+ load_dataset_btn()
20
+
21
  if __name__ == '__main__':
22
  app()