justyoung commited on
Commit
a610499
1 Parent(s): a99da07

Update src/covergen.py

Browse files
Files changed (1) hide show
  1. src/covergen.py +11 -31
src/covergen.py CHANGED
@@ -37,40 +37,20 @@ if __name__ == '__main__':
37
 
38
 
39
 
 
 
 
 
40
  with gr.Tab("Voice Conversion"):
41
  with gr.Row(equal_height=False):
42
- with gr.Column(scale=1, variant='panel'):
43
- with gr.Group():
44
- rvc_model = gr.Dropdown(voice_models, label='Voice Models')
45
- ref_btn = gr.Button('Refresh Models List', variant='primary')
46
- with gr.Group():
47
- pitch = gr.Slider(-24, 24, value=0, step=0.5, label='Pitch Adjustment', info='-24 - male voice || 24 - female voice')
48
-
49
  with gr.Column(scale=2, variant='panel'):
50
- with gr.Column() as upload_file:
51
- with gr.Group():
52
- local_file = gr.Audio(label='Audio File', interactive=False, show_download_button=False, show_share_button=False)
53
- uploaded_file = gr.UploadButton(label='Upload Audio File', file_types=['audio'], variant='primary')
54
-
55
- with gr.Column(visible=False) as enter_local_file:
56
- song_input = gr.Text(label='Local file path', info='Enter the full path to the local file.')
57
-
58
- with gr.Column():
59
- show_upload_button = gr.Button('Uploading a file from your device', visible=False)
60
- show_enter_button = gr.Button('Entering the path to the local file')
61
-
62
- uploaded_file.upload(process_file_upload, inputs=[uploaded_file], outputs=[song_input, local_file])
63
- uploaded_file.upload(update_button_text, outputs=[uploaded_file])
64
- show_upload_button.click(swap_visibility, outputs=[upload_file, enter_local_file, song_input, local_file])
65
- show_enter_button.click(swap_visibility, outputs=[enter_local_file, upload_file, song_input, local_file])
66
- show_upload_button.click(swap_buttons, outputs=[show_upload_button, show_enter_button])
67
- show_enter_button.click(swap_buttons, outputs=[show_enter_button, show_upload_button])
68
-
69
  with gr.Group():
70
- with gr.Row():
71
- generate_btn = gr.Button("Generate", variant="primary", scale=2)
72
- converted_voice = gr.Audio(label='Converted Voice', scale=9)
73
- output_format = gr.Dropdown(['mp3', 'flac', 'wav'], value='mp3', label='File Format', allow_custom_value=False, filterable=False, scale=1)
74
 
75
  with gr.Accordion('Voice Conversion Settings', open=False):
76
  with gr.Group():
@@ -91,7 +71,7 @@ if __name__ == '__main__':
91
 
92
  ref_btn.click(update_models_list, None, outputs=rvc_model)
93
  generate_btn.click(song_cover_pipeline,
94
- inputs=[song_input, rvc_model, pitch, index_rate, filter_radius, rms_mix_rate, f0_method, crepe_hop_length, protect, output_format],
95
  outputs=[converted_voice])
96
 
97
  with gr.Tab('Merge/Process'):
 
37
 
38
 
39
 
40
+ rvc_model = gr.Dropdown(voice_models, label='Voice Models')
41
+ ref_btn = gr.Button('Refresh Models List', variant='primary')
42
+ pitch = gr.Slider(-24, 24, value=0, step=0.5, label='Pitch Adjustment', info='-24 - male voice || 24 - female voice')
43
+
44
  with gr.Tab("Voice Conversion"):
45
  with gr.Row(equal_height=False):
 
 
 
 
 
 
 
46
  with gr.Column(scale=2, variant='panel'):
47
+ local_file = gr.Audio(label='Audio File', interactive=True, show_download_button=False, show_share_button=False)
48
+
49
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  with gr.Group():
51
+ generate_btn = gr.Button("Generate", variant="primary", scale=2)
52
+ converted_voice = gr.Audio(label='Converted Voice', scale=9)
53
+ output_format = gr.Dropdown(['mp3', 'flac', 'wav'], value='mp3', label='File Format', allow_custom_value=False, filterable=False, scale=1)
 
54
 
55
  with gr.Accordion('Voice Conversion Settings', open=False):
56
  with gr.Group():
 
71
 
72
  ref_btn.click(update_models_list, None, outputs=rvc_model)
73
  generate_btn.click(song_cover_pipeline,
74
+ inputs=[local_file, rvc_model, pitch, index_rate, filter_radius, rms_mix_rate, f0_method, crepe_hop_length, protect, output_format],
75
  outputs=[converted_voice])
76
 
77
  with gr.Tab('Merge/Process'):