Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import os
|
3 |
import allin1
|
4 |
import zipfile
|
|
|
5 |
from subprocess import Popen
|
6 |
from concurrent.futures import ThreadPoolExecutor
|
7 |
|
@@ -70,6 +71,10 @@ def compress_files(demucs_output_path, dissector_file, original_audio):
|
|
70 |
with ThreadPoolExecutor(max_workers=8) as executor:
|
71 |
list(executor.map(convert_to_mp3, wav_files, mp3_files))
|
72 |
|
|
|
|
|
|
|
|
|
73 |
if not os.path.exists(BASIC_PITCH_DIR):
|
74 |
os.makedirs(BASIC_PITCH_DIR)
|
75 |
command = [
|
|
|
2 |
import os
|
3 |
import allin1
|
4 |
import zipfile
|
5 |
+
import shutil
|
6 |
from subprocess import Popen
|
7 |
from concurrent.futures import ThreadPoolExecutor
|
8 |
|
|
|
71 |
with ThreadPoolExecutor(max_workers=8) as executor:
|
72 |
list(executor.map(convert_to_mp3, wav_files, mp3_files))
|
73 |
|
74 |
+
try:
|
75 |
+
shutil.rmtree(BASIC_PITCH_DIR)
|
76 |
+
except: # FileNotFoundError on first run
|
77 |
+
pass
|
78 |
if not os.path.exists(BASIC_PITCH_DIR):
|
79 |
os.makedirs(BASIC_PITCH_DIR)
|
80 |
command = [
|