Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
add rename demo sample
Browse files
app.py
CHANGED
|
@@ -29,6 +29,7 @@ from state import (
|
|
| 29 |
build_all_csv_zip,
|
| 30 |
build_xml_download,
|
| 31 |
build_all_xml_zip,
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
# ---------------------------------------------------------------------------
|
|
@@ -178,6 +179,7 @@ isDemo = False
|
|
| 178 |
if st.sidebar.button("Single File Demo (Sample)"):
|
| 179 |
load_demo_single_sample(DEMO_SAMPLE_PATH)
|
| 180 |
isDemo = True
|
|
|
|
| 181 |
|
| 182 |
if st.sidebar.button("Single File Demo (Full)"):
|
| 183 |
load_demo_single(DEMO_PATH)
|
|
@@ -187,6 +189,14 @@ if st.sidebar.button("Multiple Files Demo"):
|
|
| 187 |
load_demo_multi(MULTI_DEMO_PATHS)
|
| 188 |
isDemo = True
|
| 189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
st.sidebar.caption(
|
| 191 |
"Single File Demo (Sample) analyzes a 10-minute sample, while "
|
| 192 |
"Single File Demo (Full) analyzes the entire file. "
|
|
|
|
| 29 |
build_all_csv_zip,
|
| 30 |
build_xml_download,
|
| 31 |
build_all_xml_zip,
|
| 32 |
+
rename_sample_demo_speakers,
|
| 33 |
)
|
| 34 |
|
| 35 |
# ---------------------------------------------------------------------------
|
|
|
|
| 179 |
if st.sidebar.button("Single File Demo (Sample)"):
|
| 180 |
load_demo_single_sample(DEMO_SAMPLE_PATH)
|
| 181 |
isDemo = True
|
| 182 |
+
st.session_state["_sample_demo_loaded"] = True
|
| 183 |
|
| 184 |
if st.sidebar.button("Single File Demo (Full)"):
|
| 185 |
load_demo_single(DEMO_PATH)
|
|
|
|
| 189 |
load_demo_multi(MULTI_DEMO_PATHS)
|
| 190 |
isDemo = True
|
| 191 |
|
| 192 |
+
# Only show the rename demo button once the Sample demo has been loaded at
|
| 193 |
+
# least once in this session, and only while that file is still registered.
|
| 194 |
+
_sample_demo_fname = DEMO_SAMPLE_PATH.split("/")[-1]
|
| 195 |
+
if (st.session_state.get("_sample_demo_loaded", False)
|
| 196 |
+
and _sample_demo_fname in st.session_state.file_names):
|
| 197 |
+
if st.sidebar.button("Rename Sample Speakers"):
|
| 198 |
+
rename_sample_demo_speakers(_sample_demo_fname)
|
| 199 |
+
|
| 200 |
st.sidebar.caption(
|
| 201 |
"Single File Demo (Sample) analyzes a 10-minute sample, while "
|
| 202 |
"Single File Demo (Full) analyzes the entire file. "
|