writ_fil / app.py
Seetha's picture
Update app.py
e98811a
raw history blame
No virus
761 Bytes
import urllib.request
import streamlit as st
import os
from datasets import load_from_disk
with urllib.request.urlopen('https://huggingface.co/datasets/Seetha/visual_files/raw/main/level2.json') as response:
data = response.read()
with open('./level2.json','r+') as fi:
data = fi.read()
st.write('before change', data)
fi.seek(0)
fi.write('Hello world!')
fi.truncate()
st.write(os.path.abspath("./level2.json"))
with open('./level2.json','a') as dat:
dat.write('hello hello')
#st.write(data_after)
bin_file = open('./level2.json', 'rb')
# Execute the request
response = requests.post('https://huggingface.co/datasets/Seetha/visual_files/raw/main/level2.json', files={'file': bin_file})
# Close the file
bin_file.close()