duongthienz commited on
Commit
d4b437a
·
verified ·
1 Parent(s): fd13ed6

Add Download Multiple file .zip

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -25,6 +25,7 @@ from state import (
25
  get_display_name, apply_speaker_renames_to_df, convert_df,
26
  updateMultiSelect, store_speaker_clips, register_file, analyze,
27
  load_demo_single, load_demo_multi, run_analysis_loop,
 
28
  )
29
 
30
  # ---------------------------------------------------------------------------
@@ -333,6 +334,17 @@ try:
333
  key="download-csv", on_click="ignore",
334
  )
335
 
 
 
 
 
 
 
 
 
 
 
 
336
  # -----------------------------------------------------------------------
337
  # Tab: Rename Speaker
338
  # -----------------------------------------------------------------------
 
25
  get_display_name, apply_speaker_renames_to_df, convert_df,
26
  updateMultiSelect, store_speaker_clips, register_file, analyze,
27
  load_demo_single, load_demo_multi, run_analysis_loop,
28
+ build_all_csv_zip,
29
  )
30
 
31
  # ---------------------------------------------------------------------------
 
334
  key="download-csv", on_click="ignore",
335
  )
336
 
337
+ analyzed_count = sum(
338
+ 1 for r in st.session_state.results.values() if len(r) == 2
339
+ )
340
+ if analyzed_count > 1:
341
+ zip_bytes = build_all_csv_zip()
342
+ st.download_button(
343
+ "Download all analyzed files (.zip)", zip_bytes,
344
+ "sonogram-analysis-all.zip", "application/zip",
345
+ key="download-all-zip", on_click="ignore",
346
+ )
347
+
348
  # -----------------------------------------------------------------------
349
  # Tab: Rename Speaker
350
  # -----------------------------------------------------------------------