Seetha commited on
Commit
e90e7ba
1 Parent(s): f648e82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -31
app.py CHANGED
@@ -1,42 +1,48 @@
1
- import urllib.request
2
- import streamlit as st
3
- import os
4
- from datasets import load_from_disk
5
- import requests
6
- with urllib.request.urlopen('https://huggingface.co/datasets/Seetha/Visualization') as response:
7
- data = response.read()
 
 
 
 
 
 
 
 
8
 
9
- with open('./level2.json','r+') as fi:
10
- data = fi.read()
11
- st.write('before change', data)
12
- fi.seek(0)
13
- fi.write('Hello world!')
14
- fi.truncate()
15
- st.write(os.path.abspath("./level2.json"))
16
 
17
- with open('./level2.json','w') as dat:
18
- dat.write('hello hello')
19
- #st.write(data_after)
20
 
21
- # bin_file = open('./level2.json', 'rb')
 
22
 
23
- # # Execute the request
24
- # response = requests.post('https://huggingface.co/datasets/Seetha/Visualization', files={'file': bin_file})
25
 
26
- # # Close the file
27
- # bin_file.close()
28
 
29
- from datasets import load_dataset
 
30
 
31
- # Load the dataset
32
- dataset = load_dataset("Seetha/Visualization")
33
 
34
- # Make changes to the dataset
35
- # ...
36
 
37
- # Save the changed dataset to a file
38
- dataset.save_to_disk('./level.json')
39
 
40
- # In your Streamlit app, load the dataset from the file
41
- dataset = load_dataset('json', data_files='./level.json')
42
 
 
 
 
 
 
1
+ # import urllib.request
2
+ # import streamlit as st
3
+ # import os
4
+ # from datasets import load_from_disk
5
+ # import requests
6
+ # with urllib.request.urlopen('https://huggingface.co/datasets/Seetha/Visualization') as response:
7
+ # data = response.read()
8
+
9
+ # with open('./level2.json','r+') as fi:
10
+ # data = fi.read()
11
+ # st.write('before change', data)
12
+ # fi.seek(0)
13
+ # fi.write('Hello world!')
14
+ # fi.truncate()
15
+ # st.write(os.path.abspath("./level2.json"))
16
 
17
+ # with open('./level2.json','w') as dat:
18
+ # dat.write('hello hello')
19
+ # #st.write(data_after)
 
 
 
 
20
 
21
+ # # bin_file = open('./level2.json', 'rb')
 
 
22
 
23
+ # # # Execute the request
24
+ # # response = requests.post('https://huggingface.co/datasets/Seetha/Visualization', files={'file': bin_file})
25
 
26
+ # # # Close the file
27
+ # # bin_file.close()
28
 
29
+ # from datasets import load_dataset
 
30
 
31
+ # # Load the dataset
32
+ # dataset = load_dataset("Seetha/Visualization")
33
 
34
+ # # Make changes to the dataset
35
+ # # ...
36
 
37
+ # # Save the changed dataset to a file
38
+ # dataset.save_to_disk('./level.json')
39
 
40
+ # # In your Streamlit app, load the dataset from the file
41
+ # dataset = load_dataset('json', data_files='./level.json')
42
 
43
+ import streamlit as st
 
44
 
45
+ if st.button('Say hello'):
46
+ st.write('Why hello there')
47
+ else:
48
+ st.write('Goodbye')