File Uploader
#5
by
whitphx
HF staff
- opened
- Dockerfile +5 -1
- app.py +6 -0
Dockerfile
CHANGED
@@ -20,4 +20,8 @@ WORKDIR $HOME/app
|
|
20 |
COPY . $HOME/app
|
21 |
|
22 |
EXPOSE 8501
|
23 |
-
CMD streamlit run app.py
|
|
|
|
|
|
|
|
|
|
20 |
COPY . $HOME/app
|
21 |
|
22 |
EXPOSE 8501
|
23 |
+
CMD streamlit run app.py \
|
24 |
+
--server.headless true \
|
25 |
+
--server.enableCORS false \
|
26 |
+
--server.enableXsrfProtection false \
|
27 |
+
--server.fileWatcherType none
|
app.py
CHANGED
@@ -34,3 +34,9 @@ filtered_data = data[data[DATE_COLUMN].dt.hour == hour_to_filter]
|
|
34 |
|
35 |
st.subheader('Map of all pickups at %s:00' % hour_to_filter)
|
36 |
st.map(filtered_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
st.subheader('Map of all pickups at %s:00' % hour_to_filter)
|
36 |
st.map(filtered_data)
|
37 |
+
|
38 |
+
uploaded_file = st.file_uploader("Choose a file")
|
39 |
+
if uploaded_file is not None:
|
40 |
+
st.write(uploaded_file.name)
|
41 |
+
bytes_data = uploaded_file.getvalue()
|
42 |
+
st.write(len(bytes_data), "bytes")
|