czyoung commited on
Commit
beaf876
·
verified ·
1 Parent(s): 785ab5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -125,6 +125,7 @@ supported_file_types = ('.wav','.mp3','.mp4','.txt')
125
  valid_files = []
126
  file_paths = []
127
  audio_tabs = []
 
128
  temp_dir = tempfile.mkdtemp()
129
 
130
  if uploaded_file_paths is not None:
@@ -224,6 +225,7 @@ for i, tab in enumerate(audio_tabs):
224
  all_speaker_times[j] += timeSection[1]
225
 
226
  all_dataFrame = su.speakerListToDataFrame(sortedSpeakerList)
 
227
 
228
  # Lecturer vs. Audience
229
  #---------------------------------------------------------------------------
@@ -398,4 +400,20 @@ if st.button("Upload Files to Dataset"):
398
  save_data({"color":colorPref,"direction":radio,"number":selection},
399
  file_paths,
400
  userid)
401
- st.success('I think it worked!')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  valid_files = []
126
  file_paths = []
127
  audio_tabs = []
128
+ currDF = None
129
  temp_dir = tempfile.mkdtemp()
130
 
131
  if uploaded_file_paths is not None:
 
225
  all_speaker_times[j] += timeSection[1]
226
 
227
  all_dataFrame = su.speakerListToDataFrame(sortedSpeakerList)
228
+ currDF = all_dataFrame
229
 
230
  # Lecturer vs. Audience
231
  #---------------------------------------------------------------------------
 
400
  save_data({"color":colorPref,"direction":radio,"number":selection},
401
  file_paths,
402
  userid)
403
+ st.success('I think it worked!')
404
+
405
+ @st.cache_data
406
+ def convert_df(df):
407
+ return df.to_csv(index=False).encode('utf-8')
408
+
409
+
410
+ if currDF is not None:
411
+ csv = convert_df(currDF)
412
+
413
+ st.download_button(
414
+ "Press to Download analysis data",
415
+ csv,
416
+ "file.csv",
417
+ "text/csv",
418
+ key='download-csv'
419
+ )