Update app.py
Browse files
app.py
CHANGED
@@ -59,8 +59,13 @@ def play_audio(file_path):
|
|
59 |
|
60 |
|
61 |
|
|
|
|
|
|
|
|
|
62 |
|
63 |
|
|
|
64 |
|
65 |
|
66 |
def download_audio(url):
|
@@ -245,8 +250,10 @@ with gr.Blocks(title="Hex RVC", theme=gr.themes.Default(primary_hue="red", secon
|
|
245 |
gr.Markdown(" join [AIHub](https://discord.gg/aihub) to get the rvc model!")
|
246 |
|
247 |
with gr.Tab("Inference"):
|
|
|
|
|
248 |
with gr.Row():
|
249 |
-
|
250 |
# SOUND_PATH = gr.Textbox(label="Audio Path (Optional)", placeholder="Leave blank to upload audio")
|
251 |
upload_audio = gr.Audio(label="Upload Audio", type='filepath')
|
252 |
|
@@ -299,6 +306,7 @@ with gr.Blocks(title="Hex RVC", theme=gr.themes.Default(primary_hue="red", secon
|
|
299 |
run_button = gr.Button("Run Inference")
|
300 |
output_audio = gr.Audio(label="Generated Audio", type='filepath')
|
301 |
|
|
|
302 |
run_button.click(
|
303 |
process_audio,
|
304 |
inputs=[MODEL_NAME, SOUND_PATH, F0_CHANGE, F0_METHOD, MIN_PITCH, MAX_PITCH, CREPE_HOP_LENGTH, INDEX_RATE,
|
|
|
59 |
|
60 |
|
61 |
|
62 |
+
def update_models_list():
|
63 |
+
models_l = get_current_models(rvc_models_dir)
|
64 |
+
dropdown_instance = gr.Dropdown(choices=models_l)
|
65 |
+
return dropdown_instance
|
66 |
|
67 |
|
68 |
+
voice_models = get_current_models(rvc_models_dir)
|
69 |
|
70 |
|
71 |
def download_audio(url):
|
|
|
250 |
gr.Markdown(" join [AIHub](https://discord.gg/aihub) to get the rvc model!")
|
251 |
|
252 |
with gr.Tab("Inference"):
|
253 |
+
MODEL_NAME = gr.Dropdown(voice_models, label='Voice Models', info='Models folder "AICoverGen --> rvc_models". After new models are added into this folder, click the refresh button')
|
254 |
+
ref_btn = gr.Button('Refresh Models 🔁', variant='primary')
|
255 |
with gr.Row():
|
256 |
+
# = gr.Textbox(label="Model Name", placeholder="Enter model name")
|
257 |
# SOUND_PATH = gr.Textbox(label="Audio Path (Optional)", placeholder="Leave blank to upload audio")
|
258 |
upload_audio = gr.Audio(label="Upload Audio", type='filepath')
|
259 |
|
|
|
306 |
run_button = gr.Button("Run Inference")
|
307 |
output_audio = gr.Audio(label="Generated Audio", type='filepath')
|
308 |
|
309 |
+
ref_btn.click(update_models_list, None, outputs=MODEL_NAME)
|
310 |
run_button.click(
|
311 |
process_audio,
|
312 |
inputs=[MODEL_NAME, SOUND_PATH, F0_CHANGE, F0_METHOD, MIN_PITCH, MAX_PITCH, CREPE_HOP_LENGTH, INDEX_RATE,
|