Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -367,6 +367,10 @@ if 'unusedSpeakers' not in st.session_state:
|
|
| 367 |
st.session_state.unusedSpeakers = []
|
| 368 |
if 'file_names' not in st.session_state:
|
| 369 |
st.session_state.file_names = []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
if 'showSummary' not in st.session_state:
|
| 371 |
st.session_state.showSummary = 'No'
|
| 372 |
|
|
@@ -388,12 +392,12 @@ uploaded_file_paths = st.file_uploader("Upload an audio of classroom activity to
|
|
| 388 |
supported_file_types = ('.wav','.mp3','.mp4','.txt','.rttm','.csv')
|
| 389 |
viewChoices = ["Voice Categories","Custom Categories","Detailed Voice Categories","Voice Category Treemap","Speaker Timeline","Time per Speaker"]
|
| 390 |
|
| 391 |
-
valid_files =
|
| 392 |
-
file_paths =
|
| 393 |
currDF = None
|
| 394 |
temp_dir = tempfile.mkdtemp()
|
| 395 |
|
| 396 |
-
if uploaded_file_paths is not None:
|
| 397 |
print("Found file paths")
|
| 398 |
valid_files = []
|
| 399 |
file_paths = []
|
|
@@ -429,6 +433,8 @@ if uploaded_file_paths is not None:
|
|
| 429 |
st.session_state.speakerRenames.append({})
|
| 430 |
|
| 431 |
st.session_state.file_names = file_names
|
|
|
|
|
|
|
| 432 |
|
| 433 |
file_names = st.session_state.file_names
|
| 434 |
|
|
@@ -517,6 +523,8 @@ if st.sidebar.button("Load Demo Example"):
|
|
| 517 |
valid_files=[sampleUpload]
|
| 518 |
file_paths=[sampleUpload.path]
|
| 519 |
file_names=[sampleUpload.name]
|
|
|
|
|
|
|
| 520 |
start_time = time.time()
|
| 521 |
st.session_state.file_names = file_names
|
| 522 |
# Save valid file names
|
|
|
|
| 367 |
st.session_state.unusedSpeakers = []
|
| 368 |
if 'file_names' not in st.session_state:
|
| 369 |
st.session_state.file_names = []
|
| 370 |
+
if 'valid_files' not in st.session_state:
|
| 371 |
+
st.session_state.valid_files = []
|
| 372 |
+
if 'file_paths' not in st.session_state:
|
| 373 |
+
st.session_state.file_paths = []
|
| 374 |
if 'showSummary' not in st.session_state:
|
| 375 |
st.session_state.showSummary = 'No'
|
| 376 |
|
|
|
|
| 392 |
supported_file_types = ('.wav','.mp3','.mp4','.txt','.rttm','.csv')
|
| 393 |
viewChoices = ["Voice Categories","Custom Categories","Detailed Voice Categories","Voice Category Treemap","Speaker Timeline","Time per Speaker"]
|
| 394 |
|
| 395 |
+
valid_files = st.session_state.valid_files
|
| 396 |
+
file_paths = st.session_state.file_paths
|
| 397 |
currDF = None
|
| 398 |
temp_dir = tempfile.mkdtemp()
|
| 399 |
|
| 400 |
+
if uploaded_file_paths is not None and len(uploaded_file_paths) > 0:
|
| 401 |
print("Found file paths")
|
| 402 |
valid_files = []
|
| 403 |
file_paths = []
|
|
|
|
| 433 |
st.session_state.speakerRenames.append({})
|
| 434 |
|
| 435 |
st.session_state.file_names = file_names
|
| 436 |
+
st.session_state.valid_files = valid_files
|
| 437 |
+
st.session_state.file_paths = file_paths
|
| 438 |
|
| 439 |
file_names = st.session_state.file_names
|
| 440 |
|
|
|
|
| 523 |
valid_files=[sampleUpload]
|
| 524 |
file_paths=[sampleUpload.path]
|
| 525 |
file_names=[sampleUpload.name]
|
| 526 |
+
st.session_state.valid_files = valid_files
|
| 527 |
+
st.session_state.file_paths = file_paths
|
| 528 |
start_time = time.time()
|
| 529 |
st.session_state.file_names = file_names
|
| 530 |
# Save valid file names
|