udituen commited on
Commit
52f2f7e
·
1 Parent(s): a2eec0a

fixing file uplaod

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. main.py +14 -0
Dockerfile CHANGED
@@ -18,4 +18,4 @@ EXPOSE 8501
18
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
21
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
18
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
21
+ ENTRYPOINT ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]
main.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+
4
+
5
+
6
+ uploaded_file = st.file_uploader("Upload your file", type=["txt","pdf"])
7
+ if uploaded_file is not None:
8
+ st.write("Filename:", uploaded_file.name)
9
+ data = uploaded_file.read()
10
+
11
+ if uploaded_file.type == "text/plain":
12
+ st.text_area("Content", data.decode("utf-8"), height=300)
13
+ else:
14
+ st.info(f"Uploaded {len(data)} bytes (PDF or other format)")