Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Correct button and tab functionality
Browse files
app.py
CHANGED
|
@@ -56,18 +56,19 @@ if uploaded_file_paths is not None:
|
|
| 56 |
else:
|
| 57 |
if uploaded_file not in valid_files:
|
| 58 |
valid_files.append(uploaded_file)
|
| 59 |
-
|
|
|
|
| 60 |
|
| 61 |
-
for tab in audio_tabs:
|
| 62 |
-
if tab.button("Analyze Audio"):
|
| 63 |
if uploaded_file is None:
|
| 64 |
tab.error('Upload a file first!')
|
| 65 |
else:
|
| 66 |
# Process
|
| 67 |
# Pretend to take time as an example
|
| 68 |
-
with
|
| 69 |
time.sleep(5)
|
| 70 |
-
|
| 71 |
|
| 72 |
# RTTM load as filler
|
| 73 |
speakerList, annotations = su.loadAudioRTTM("24F CHEM1402 Night Class Week 4.rttm")
|
|
|
|
| 56 |
else:
|
| 57 |
if uploaded_file not in valid_files:
|
| 58 |
valid_files.append(uploaded_file)
|
| 59 |
+
if len(valid_files) > 0:
|
| 60 |
+
audio_tabs = st.tabs([f.name for f in valid_files])
|
| 61 |
|
| 62 |
+
for j, tab in enumerate(audio_tabs):
|
| 63 |
+
if tab.button("Analyze Audio",key=f"button_{j}"):
|
| 64 |
if uploaded_file is None:
|
| 65 |
tab.error('Upload a file first!')
|
| 66 |
else:
|
| 67 |
# Process
|
| 68 |
# Pretend to take time as an example
|
| 69 |
+
with st.spinner(text='NOT ACTUALLY ANALYZING, JUST A FILLER ANIMATION'):
|
| 70 |
time.sleep(5)
|
| 71 |
+
st.success('Done')
|
| 72 |
|
| 73 |
# RTTM load as filler
|
| 74 |
speakerList, annotations = su.loadAudioRTTM("24F CHEM1402 Night Class Week 4.rttm")
|