Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def convert(audio_picker,model_picker,index_picker,index_rate,pitch,method):
|
|
46 |
"--input_path", f"audios/{audio_picker}",
|
47 |
"--index_path", index_files[0],
|
48 |
"--f0method", method,
|
49 |
-
"--opt_path", f"audios/cli_output_{
|
50 |
"--model_name", f"{model_picker}",
|
51 |
"--index_rate", str(float(index_rate)),
|
52 |
"--device", device,
|
@@ -59,7 +59,7 @@ def convert(audio_picker,model_picker,index_picker,index_rate,pitch,method):
|
|
59 |
try:
|
60 |
process = subprocess.run(command, check=True)
|
61 |
print("Script executed successfully.")
|
62 |
-
return {"choices":show_available("audios"),"__type__":"update","value":f"cli_output_{
|
63 |
except subprocess.CalledProcessError as e:
|
64 |
print(f"Error: {e}")
|
65 |
return {"choices":show_available("audios"),"__type__":"update"}, None
|
@@ -277,6 +277,8 @@ with gr.Blocks(theme="ParityError/Interstellar") as app:
|
|
277 |
model_picker = gr.Dropdown(label="Model: ",choices=show_available('assets/weights','.pth'),value=show_available('assets/weights','.pth'),interactive=True,allow_custom_value=True)
|
278 |
index_picker = gr.Dropdown(label="Index:",interactive=True,choices=show_available('logs'),value=show_available('logs'),allow_custom_value=True)
|
279 |
model_picker.change(fn=load_model,inputs=[model_picker,index_picker],outputs=[index_picker])
|
|
|
|
|
280 |
with gr.TabItem("(Or download a model here)"):
|
281 |
with gr.Row():
|
282 |
url = gr.Textbox(label="Paste the URL here:",value="",placeholder="(i.e. https://huggingface.co/repo/model/resolve/main/model.zip)")
|
@@ -315,7 +317,7 @@ with gr.Blocks(theme="ParityError/Interstellar") as app:
|
|
315 |
|
316 |
with gr.Row():
|
317 |
audio_refresher = gr.Button("Refresh")
|
318 |
-
audio_refresher.click(fn=refresh,inputs=[],outputs=[audio_picker
|
319 |
convert_button = gr.Button("Convert")
|
320 |
with gr.Row():
|
321 |
audio_player = gr.Audio()
|
|
|
46 |
"--input_path", f"audios/{audio_picker}",
|
47 |
"--index_path", index_files[0],
|
48 |
"--f0method", method,
|
49 |
+
"--opt_path", f"audios/cli_output_{audio_name}.wav",
|
50 |
"--model_name", f"{model_picker}",
|
51 |
"--index_rate", str(float(index_rate)),
|
52 |
"--device", device,
|
|
|
59 |
try:
|
60 |
process = subprocess.run(command, check=True)
|
61 |
print("Script executed successfully.")
|
62 |
+
return {"choices":show_available("audios"),"__type__":"update","value":f"cli_output_{audio_name}.wav"},f"audios/cli_output_{audio_name}.wav"
|
63 |
except subprocess.CalledProcessError as e:
|
64 |
print(f"Error: {e}")
|
65 |
return {"choices":show_available("audios"),"__type__":"update"}, None
|
|
|
277 |
model_picker = gr.Dropdown(label="Model: ",choices=show_available('assets/weights','.pth'),value=show_available('assets/weights','.pth'),interactive=True,allow_custom_value=True)
|
278 |
index_picker = gr.Dropdown(label="Index:",interactive=True,choices=show_available('logs'),value=show_available('logs'),allow_custom_value=True)
|
279 |
model_picker.change(fn=load_model,inputs=[model_picker,index_picker],outputs=[index_picker])
|
280 |
+
model_refresher = gr.Button("Refresh")
|
281 |
+
model_refresher.click(fn=refresh,inputs=[],outputs=[model_picker,index_picker])
|
282 |
with gr.TabItem("(Or download a model here)"):
|
283 |
with gr.Row():
|
284 |
url = gr.Textbox(label="Paste the URL here:",value="",placeholder="(i.e. https://huggingface.co/repo/model/resolve/main/model.zip)")
|
|
|
317 |
|
318 |
with gr.Row():
|
319 |
audio_refresher = gr.Button("Refresh")
|
320 |
+
audio_refresher.click(fn=refresh,inputs=[],outputs=[audio_picker])
|
321 |
convert_button = gr.Button("Convert")
|
322 |
with gr.Row():
|
323 |
audio_player = gr.Audio()
|