Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -361,9 +361,9 @@ else:
|
|
| 361 |
for i in range(totalFiles):
|
| 362 |
if len(st.session_state.results) > i and len(st.session_state.results[i]) > 0 and st.session_state.results[i][0] == file_names[i]:
|
| 363 |
continue
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
time.sleep(1)
|
| 368 |
# RTTM load as filler
|
| 369 |
speakerList, annotations = su.loadAudioRTTM(sample_data[i])
|
|
@@ -376,13 +376,15 @@ else:
|
|
| 376 |
st.session_state.summaries[i] = {}
|
| 377 |
speakerNames = annotations.labels()
|
| 378 |
st.session_state.unusedSpeakers[i] = speakerNames
|
| 379 |
-
|
| 380 |
-
|
|
|
|
| 381 |
speakerList, annotations, totalSeconds = processFile(file_paths[i])
|
| 382 |
st.session_state.results[i] = (speakerList,annotations, totalSeconds)
|
| 383 |
st.session_state.summaries[i] = {}
|
| 384 |
speakerNames = annotations.labels()
|
| 385 |
st.session_state.unusedSpeakers[i] = speakerNames
|
|
|
|
| 386 |
analyze(file_names[i])
|
| 387 |
st.success(f"Took {time.time() - start_time} seconds to analyze {totalFiles} files!")
|
| 388 |
|
|
|
|
| 361 |
for i in range(totalFiles):
|
| 362 |
if len(st.session_state.results) > i and len(st.session_state.results[i]) > 0 and st.session_state.results[i][0] == file_names[i]:
|
| 363 |
continue
|
| 364 |
+
# Text files use sample data
|
| 365 |
+
if file_paths[i].endswith('.txt'):
|
| 366 |
+
with st.spinner(text=f'Loading Demo File {i+1} of {totalFiles}'):
|
| 367 |
time.sleep(1)
|
| 368 |
# RTTM load as filler
|
| 369 |
speakerList, annotations = su.loadAudioRTTM(sample_data[i])
|
|
|
|
| 376 |
st.session_state.summaries[i] = {}
|
| 377 |
speakerNames = annotations.labels()
|
| 378 |
st.session_state.unusedSpeakers[i] = speakerNames
|
| 379 |
+
else:
|
| 380 |
+
#st.info(file_paths[i])
|
| 381 |
+
with st.spinner(text=f'Processing File {i+1} of {totalFiles}'):
|
| 382 |
speakerList, annotations, totalSeconds = processFile(file_paths[i])
|
| 383 |
st.session_state.results[i] = (speakerList,annotations, totalSeconds)
|
| 384 |
st.session_state.summaries[i] = {}
|
| 385 |
speakerNames = annotations.labels()
|
| 386 |
st.session_state.unusedSpeakers[i] = speakerNames
|
| 387 |
+
with st.spinner(text=f'Analyzing File {i+1} of {totalFiles}'):
|
| 388 |
analyze(file_names[i])
|
| 389 |
st.success(f"Took {time.time() - start_time} seconds to analyze {totalFiles} files!")
|
| 390 |
|