Spaces:
Runtime error
Runtime error
chandralegend
commited on
Commit
•
387e0cc
1
Parent(s):
37cdb35
added the initial implementation
Browse files- .vscode/settings.json +6 -0
- app.py +22 -0
- requirements.txt +1 -0
.vscode/settings.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[python]": {
|
3 |
+
"editor.defaultFormatter": "ms-python.black-formatter"
|
4 |
+
},
|
5 |
+
"python.formatting.provider": "none"
|
6 |
+
}
|
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import os
|
3 |
+
import uuid
|
4 |
+
|
5 |
+
st.header("Testing File Creation in HuggingFace")
|
6 |
+
|
7 |
+
with st.button("Create File"):
|
8 |
+
random_file_name = str(uuid.uuid4())
|
9 |
+
with open(f"{random_file_name}.txt", "w") as f:
|
10 |
+
f.write("Hello World!")
|
11 |
+
st.info(f"Created file {random_file_name}.txt")
|
12 |
+
|
13 |
+
file_name = st.text_input("Enter file name to delete")
|
14 |
+
with st.button("Delete File"):
|
15 |
+
if os.path.exists(file_name):
|
16 |
+
os.remove(file_name)
|
17 |
+
st.info(f"Deleted file {file_name}")
|
18 |
+
else:
|
19 |
+
st.error(f"File {file_name} does not exist")
|
20 |
+
|
21 |
+
with st.button("List Files"):
|
22 |
+
st.info(os.listdir())
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
streamlit
|