Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -248,11 +248,27 @@ with gr.Blocks() as app:
|
|
| 248 |
with gr.Row():
|
| 249 |
with gr.Column():
|
| 250 |
with gr.Tabs():
|
| 251 |
-
with gr.TabItem("
|
| 252 |
model_picker = gr.Dropdown(label="Model: ",choices=show_available('assets/weights','.pth'),value=show_available('assets/weights','.pth')[0],interactive=True,allow_custom_value=True)
|
| 253 |
index_picker = gr.Dropdown(label="Index:",interactive=True,choices=show_available('logs'),value=show_available('logs')[0],allow_custom_value=True)
|
| 254 |
model_picker.change(fn=load_model,inputs=[model_picker,index_picker],outputs=[index_picker])
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
with gr.Row():
|
| 257 |
url = gr.Textbox(label="Paste the URL here:",value="",placeholder="(i.e. https://huggingface.co/repo/model/resolve/main/model.zip)")
|
| 258 |
with gr.Row():
|
|
@@ -270,28 +286,7 @@ with gr.Blocks() as app:
|
|
| 270 |
pitch = gr.Slider(label='Pitch (-12 lowers it an octave, 0 keeps the original pitch, 12 lifts it an octave): ',minimum =-12, maximum=12, step=1, value=0, interactive=True)
|
| 271 |
method = gr.Dropdown(label="Method:",choices=["rmvpe","pm"],value="rmvpe")
|
| 272 |
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
with gr.TabItem("2.Choose an audio file:"):
|
| 276 |
-
recorder = gr.Microphone(label="Record audio here...",type='filepath')
|
| 277 |
-
audio_picker = gr.Dropdown(label="",choices=show_available('audios'),value='',interactive=True)
|
| 278 |
-
try:
|
| 279 |
-
recorder.stop_recording(upload_file, inputs=[recorder],outputs=[audio_picker])
|
| 280 |
-
except:
|
| 281 |
-
recorder.upload(upload_file, inputs=[recorder],outputs=[audio_picker])
|
| 282 |
-
with gr.TabItem("(Or upload a new file here)"):
|
| 283 |
-
try:
|
| 284 |
-
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="filepath")
|
| 285 |
-
except:#Version Compatibiliy
|
| 286 |
-
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="file")
|
| 287 |
-
dropbox.upload(fn=upload_file, inputs=[dropbox],outputs=[audio_picker])
|
| 288 |
-
audio_refresher = gr.Button("Refresh")
|
| 289 |
-
audio_refresher.click(fn=refresh,inputs=[],outputs=[audio_picker,model_picker,index_picker])
|
| 290 |
-
convert_button = gr.Button("Convert")
|
| 291 |
-
with gr.Row():
|
| 292 |
-
audio_player = gr.Audio()
|
| 293 |
-
inputs = [audio_picker,model_picker,index_picker,index_rate,pitch,method]
|
| 294 |
-
audio_picker.change(fn=update_audio_player, inputs=[audio_picker],outputs=[audio_player])
|
| 295 |
-
convert_button.click(convert, inputs=inputs,outputs=[audio_picker,audio_player])
|
| 296 |
|
| 297 |
app.queue(max_size=20).launch(debug=True,share=True)
|
|
|
|
| 248 |
with gr.Row():
|
| 249 |
with gr.Column():
|
| 250 |
with gr.Tabs():
|
| 251 |
+
with gr.TabItem("inference:"):
|
| 252 |
model_picker = gr.Dropdown(label="Model: ",choices=show_available('assets/weights','.pth'),value=show_available('assets/weights','.pth')[0],interactive=True,allow_custom_value=True)
|
| 253 |
index_picker = gr.Dropdown(label="Index:",interactive=True,choices=show_available('logs'),value=show_available('logs')[0],allow_custom_value=True)
|
| 254 |
model_picker.change(fn=load_model,inputs=[model_picker,index_picker],outputs=[index_picker])
|
| 255 |
+
audio_refresher = gr.Button("Refresh")
|
| 256 |
+
audio_refresher.click(fn=refresh,inputs=[],outputs=[audio_picker,model_picker,index_picker])
|
| 257 |
+
with gr.Row():
|
| 258 |
+
convert_button = gr.Button("Convert")
|
| 259 |
+
convert_button.click(convert, inputs=inputs,outputs=[audio_picker,audio_player])
|
| 260 |
+
with gr.Group():
|
| 261 |
+
audio_picker = gr.Dropdown(label="",choices=show_available('audios'),value='',interactive=True)
|
| 262 |
+
audio_player = gr.Audio()
|
| 263 |
+
inputs = [audio_picker,model_picker,index_picker,index_rate,pitch,method]
|
| 264 |
+
audio_picker.change(fn=update_audio_player, inputs=[audio_picker],outputs=[audio_player])
|
| 265 |
+
with gr.TabItem("(Or upload a new file here)"):
|
| 266 |
+
try:
|
| 267 |
+
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="filepath")
|
| 268 |
+
except:#Version Compatibiliy
|
| 269 |
+
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="file")
|
| 270 |
+
dropbox.upload(fn=upload_file, inputs=[dropbox],outputs=[audio_picker])
|
| 271 |
+
with gr.TabItem("download a model here"):
|
| 272 |
with gr.Row():
|
| 273 |
url = gr.Textbox(label="Paste the URL here:",value="",placeholder="(i.e. https://huggingface.co/repo/model/resolve/main/model.zip)")
|
| 274 |
with gr.Row():
|
|
|
|
| 286 |
pitch = gr.Slider(label='Pitch (-12 lowers it an octave, 0 keeps the original pitch, 12 lifts it an octave): ',minimum =-12, maximum=12, step=1, value=0, interactive=True)
|
| 287 |
method = gr.Dropdown(label="Method:",choices=["rmvpe","pm"],value="rmvpe")
|
| 288 |
|
| 289 |
+
|
| 290 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
app.queue(max_size=20).launch(debug=True,share=True)
|