Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import librosa
|
|
5 |
import soundfile as sf
|
6 |
import os
|
7 |
import zipfile
|
|
|
8 |
|
9 |
|
10 |
# Function to download audio from YouTube and save it as a WAV file
|
@@ -166,17 +167,25 @@ def process_audio(url, audio_name):
|
|
166 |
zip_file = zip_directory(dataset_path, audio_name)
|
167 |
return zip_file, print(f"{zip_file} successfully processed")
|
168 |
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
|
171 |
-
|
172 |
-
negra = gr.themes.Base(
|
173 |
primary_hue="blue",
|
174 |
secondary_hue="blue")
|
175 |
|
176 |
|
177 |
-
with gr.Blocks(theme=
|
178 |
gr.Markdown("# <div style='text-align: center;'> RVC DATASET MAKER</div>")
|
179 |
gr.Markdown(" <div style='text-align: center;'> only work for vocal only audio!</div>")
|
|
|
|
|
|
|
|
|
180 |
with gr.Tabs():
|
181 |
with gr.TabItem("make dataset"):
|
182 |
with gr.Row():
|
@@ -189,16 +198,7 @@ with gr.Blocks(theme=negra) as demo:
|
|
189 |
with gr.Row():
|
190 |
run_button = gr.Button("Slice 👾 Audio")
|
191 |
run_button.click(fn=process_audio, inputs=[url_input, audio_name_input], outputs=[result_output, result_process])
|
192 |
-
|
193 |
-
with gr.Row():
|
194 |
-
gr.Markdown(
|
195 |
-
f"""
|
196 |
-
|
197 |
-
# colab version:
|
198 |
-
[click here](https://colab.research.google.com/drive/1b7CpTBpMtd26KgZ8IhpEAkR2ehU11Amp?usp=sharing)
|
199 |
-
"""
|
200 |
-
)
|
201 |
-
|
202 |
with gr.Tabs():
|
203 |
gr.Markdown(f"### <div style='text-align: center;'>made with ❤ by <a href='https://huggingface.co/Hev832'>Hev832</a></div>")
|
204 |
|
|
|
5 |
import soundfile as sf
|
6 |
import os
|
7 |
import zipfile
|
8 |
+
from argparse import ArgumentParser
|
9 |
|
10 |
|
11 |
# Function to download audio from YouTube and save it as a WAV file
|
|
|
167 |
zip_file = zip_directory(dataset_path, audio_name)
|
168 |
return zip_file, print(f"{zip_file} successfully processed")
|
169 |
|
170 |
+
if __name__ == '__main__':
|
171 |
+
parser = ArgumentParser()
|
172 |
+
parser.add_argument("--colab", action="store_true", dest="share_enabled", default=False, help="Enable sharing")
|
173 |
+
|
174 |
+
args = parser.parse_args()
|
175 |
|
176 |
|
177 |
+
thme = gr.themes.Soft(
|
|
|
178 |
primary_hue="blue",
|
179 |
secondary_hue="blue")
|
180 |
|
181 |
|
182 |
+
with gr.Blocks(theme=thme) as demo:
|
183 |
gr.Markdown("# <div style='text-align: center;'> RVC DATASET MAKER</div>")
|
184 |
gr.Markdown(" <div style='text-align: center;'> only work for vocal only audio!</div>")
|
185 |
+
if config.iscolab:
|
186 |
+
pass
|
187 |
+
else:
|
188 |
+
gr.Markdown("<div style='text-align: center;'> please `❤` this spaces 🤗 if helpfull</dif>")
|
189 |
with gr.Tabs():
|
190 |
with gr.TabItem("make dataset"):
|
191 |
with gr.Row():
|
|
|
198 |
with gr.Row():
|
199 |
run_button = gr.Button("Slice 👾 Audio")
|
200 |
run_button.click(fn=process_audio, inputs=[url_input, audio_name_input], outputs=[result_output, result_process])
|
201 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
with gr.Tabs():
|
203 |
gr.Markdown(f"### <div style='text-align: center;'>made with ❤ by <a href='https://huggingface.co/Hev832'>Hev832</a></div>")
|
204 |
|