Liam Pond commited on
Commit
e92ae9b
Β·
1 Parent(s): 7972254

Removed unnecessary clear files button

Browse files
Files changed (1) hide show
  1. app.py +4 -25
app.py CHANGED
@@ -386,13 +386,8 @@ if filetype == "MEI":
386
 
387
  st.session_state.edited_syllables = updated_syllables
388
 
389
- st.header("3. Actions")
390
- col_confirm, col_clear = st.columns([1, 2])
391
- with col_confirm:
392
- confirm_clicked = st.button("βœ… Synthesize", key="confirm_button_mei")
393
-
394
- with col_clear:
395
- clear_clicked = st.button("πŸ—‘οΈ Clear Uploaded Files", key="clear_button_mei")
396
 
397
  if confirm_clicked:
398
  ds_path = TMP_DS_DIR / f"{mei_path.stem}.ds"
@@ -416,22 +411,12 @@ if filetype == "MEI":
416
  st.audio(str(wav_path))
417
  st.download_button("Download WAV", data=open(wav_path, "rb"), file_name=wav_path.name)
418
 
419
- if clear_clicked:
420
- for d in [UPLOAD_MEI_DIR, UPLOAD_DS_DIR, TMP_DS_DIR, OUTPUT_DIR]:
421
- shutil.rmtree(d, ignore_errors=True)
422
- d.mkdir(parents=True, exist_ok=True)
423
- st.rerun()
424
-
425
  elif filetype == "DS":
426
  st.header("1. Upload DS File")
427
  ds_file = st.file_uploader("Upload your .ds file", type=["ds", "json"])
428
 
429
  st.header("2. Synthesize")
430
- col_syn, col_clear = st.columns([1, 2])
431
- with col_syn:
432
- synth_clicked = st.button("βœ… Synthesize", key="synthesize_button_ds")
433
- with col_clear:
434
- clear_ds_clicked = st.button("πŸ—‘οΈ Clear", key="clear_button_ds")
435
 
436
  if synth_clicked:
437
  if not ds_file:
@@ -457,10 +442,4 @@ elif filetype == "DS":
457
 
458
  st.success("Synthesis complete!")
459
  st.audio(str(wav_path))
460
- st.download_button("Download WAV", data=open(wav_path, "rb"), file_name=wav_path.name)
461
-
462
- if clear_ds_clicked:
463
- for d in [UPLOAD_MEI_DIR, UPLOAD_DS_DIR, TMP_DS_DIR, OUTPUT_DIR]:
464
- shutil.rmtree(d, ignore_errors=True)
465
- d.mkdir(parents=True, exist_ok=True)
466
- st.rerun()
 
386
 
387
  st.session_state.edited_syllables = updated_syllables
388
 
389
+ st.header("3. Synthesize")
390
+ confirm_clicked = st.button("βœ… Synthesize", key="confirm_button_mei")
 
 
 
 
 
391
 
392
  if confirm_clicked:
393
  ds_path = TMP_DS_DIR / f"{mei_path.stem}.ds"
 
411
  st.audio(str(wav_path))
412
  st.download_button("Download WAV", data=open(wav_path, "rb"), file_name=wav_path.name)
413
 
 
 
 
 
 
 
414
  elif filetype == "DS":
415
  st.header("1. Upload DS File")
416
  ds_file = st.file_uploader("Upload your .ds file", type=["ds", "json"])
417
 
418
  st.header("2. Synthesize")
419
+ synth_clicked = st.button("βœ… Synthesize", key="synthesize_button_ds")
 
 
 
 
420
 
421
  if synth_clicked:
422
  if not ds_file:
 
442
 
443
  st.success("Synthesis complete!")
444
  st.audio(str(wav_path))
445
+ st.download_button("Download WAV", data=open(wav_path, "rb"), file_name=wav_path.name)