duongthienz commited on
Commit
df0e73c
·
verified ·
1 Parent(s): 5b6cb3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -95,7 +95,9 @@ def extract_speaker_clip(audio_path, annotation, speaker, clip_duration=5):
95
  buffer.seek(0)
96
  return buffer.read()
97
  except Exception as e:
 
98
  print(f"extract_speaker_clip error for {speaker}: {e}")
 
99
  return None
100
 
101
  @st.cache_data
@@ -440,7 +442,9 @@ viewChoices = ["Voice Categories","Custom Categories","Detailed Voice Categories
440
  valid_files = st.session_state.valid_files
441
  file_paths = st.session_state.file_paths
442
  currDF = None
443
- temp_dir = tempfile.mkdtemp()
 
 
444
 
445
  if uploaded_file_paths is not None and len(uploaded_file_paths) > 0:
446
  print("Found file paths")
 
95
  buffer.seek(0)
96
  return buffer.read()
97
  except Exception as e:
98
+ import traceback
99
  print(f"extract_speaker_clip error for {speaker}: {e}")
100
+ traceback.print_exc()
101
  return None
102
 
103
  @st.cache_data
 
442
  valid_files = st.session_state.valid_files
443
  file_paths = st.session_state.file_paths
444
  currDF = None
445
+ if 'temp_dir' not in st.session_state:
446
+ st.session_state.temp_dir = tempfile.mkdtemp()
447
+ temp_dir = st.session_state.temp_dir
448
 
449
  if uploaded_file_paths is not None and len(uploaded_file_paths) > 0:
450
  print("Found file paths")