Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ import librosa
|
|
12 |
import librosa.display
|
13 |
import matplotlib.pyplot as plt
|
14 |
|
|
|
15 |
def download_youtube_video_as_wav(youtube_url):
|
16 |
output_dir = "downloads"
|
17 |
os.makedirs(output_dir, exist_ok=True)
|
@@ -63,6 +64,7 @@ def generate_spectrogram(audio_file_path):
|
|
63 |
plt.close()
|
64 |
return image_path
|
65 |
|
|
|
66 |
def generate_spectrograms(audio_files):
|
67 |
output_spectrograms = []
|
68 |
for audio_file in audio_files:
|
@@ -72,7 +74,6 @@ def generate_spectrograms(audio_files):
|
|
72 |
|
73 |
def separate_music_file_wrapper(input_string, use_cpu, use_single_onnx, large_overlap, small_overlap, chunk_size, use_large_gpu):
|
74 |
input_files = []
|
75 |
-
|
76 |
# Validate YouTube URL or directory path
|
77 |
if input_string.startswith("https://www.youtube.com") or input_string.startswith("https://youtu.be"):
|
78 |
output_file = download_youtube_video_as_wav(input_string)
|
@@ -119,7 +120,6 @@ def separate_music_file_wrapper(input_string, use_cpu, use_single_onnx, large_ov
|
|
119 |
output_files["drums"] = os.path.join(options['output_folder'], audio_file_name + "_drums.wav")
|
120 |
output_files["other"] = os.path.join(options['output_folder'], audio_file_name + "_other.wav")
|
121 |
|
122 |
-
|
123 |
# Check the readiness of the files
|
124 |
output_files_ready = []
|
125 |
for k, v in output_files.items():
|
@@ -141,6 +141,7 @@ def separate_music_file_wrapper(input_string, use_cpu, use_single_onnx, large_ov
|
|
141 |
return tuple(output_files_ready) + output_spectrograms
|
142 |
print("After return")
|
143 |
|
|
|
144 |
description = """
|
145 |
# ZFTurbo Web-UI
|
146 |
Web-UI by [Ma5onic](https://github.com/Ma5onic)
|
|
|
12 |
import librosa.display
|
13 |
import matplotlib.pyplot as plt
|
14 |
|
15 |
+
|
16 |
def download_youtube_video_as_wav(youtube_url):
|
17 |
output_dir = "downloads"
|
18 |
os.makedirs(output_dir, exist_ok=True)
|
|
|
64 |
plt.close()
|
65 |
return image_path
|
66 |
|
67 |
+
|
68 |
def generate_spectrograms(audio_files):
|
69 |
output_spectrograms = []
|
70 |
for audio_file in audio_files:
|
|
|
74 |
|
75 |
def separate_music_file_wrapper(input_string, use_cpu, use_single_onnx, large_overlap, small_overlap, chunk_size, use_large_gpu):
|
76 |
input_files = []
|
|
|
77 |
# Validate YouTube URL or directory path
|
78 |
if input_string.startswith("https://www.youtube.com") or input_string.startswith("https://youtu.be"):
|
79 |
output_file = download_youtube_video_as_wav(input_string)
|
|
|
120 |
output_files["drums"] = os.path.join(options['output_folder'], audio_file_name + "_drums.wav")
|
121 |
output_files["other"] = os.path.join(options['output_folder'], audio_file_name + "_other.wav")
|
122 |
|
|
|
123 |
# Check the readiness of the files
|
124 |
output_files_ready = []
|
125 |
for k, v in output_files.items():
|
|
|
141 |
return tuple(output_files_ready) + output_spectrograms
|
142 |
print("After return")
|
143 |
|
144 |
+
|
145 |
description = """
|
146 |
# ZFTurbo Web-UI
|
147 |
Web-UI by [Ma5onic](https://github.com/Ma5onic)
|