Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -2
src/streamlit_app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import io
|
3 |
import csv
|
|
|
4 |
from segments import SegmentsClient
|
5 |
from get_labels_from_samples import (
|
6 |
get_samples as get_samples_objects,
|
@@ -193,9 +194,11 @@ if st.session_state.error:
|
|
193 |
st.error(st.session_state.error)
|
194 |
|
195 |
if st.session_state.csv_content:
|
|
|
|
|
196 |
st.download_button(
|
197 |
-
|
198 |
data=st.session_state.csv_content,
|
199 |
-
file_name=
|
200 |
mime="text/csv"
|
201 |
)
|
|
|
1 |
import streamlit as st
|
2 |
import io
|
3 |
import csv
|
4 |
+
from datetime import datetime
|
5 |
from segments import SegmentsClient
|
6 |
from get_labels_from_samples import (
|
7 |
get_samples as get_samples_objects,
|
|
|
194 |
st.error(st.session_state.error)
|
195 |
|
196 |
if st.session_state.csv_content:
|
197 |
+
today_str = datetime.now().strftime("%Y%m%d")
|
198 |
+
filename = f"{today_str}_{dataset_identifier}_count-by-class.csv"
|
199 |
st.download_button(
|
200 |
+
"Download CSV",
|
201 |
data=st.session_state.csv_content,
|
202 |
+
file_name=filename,
|
203 |
mime="text/csv"
|
204 |
)
|