Rejekts commited on
Commit
fdf5372
1 Parent(s): 32c8ebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,7 +6,7 @@ os.environ["rmvpe_root"] = "assets/rmvpe"
6
  os.environ['index_root']="logs"
7
  os.environ['weight_root']="assets/weights"
8
 
9
- def convert(audio_picker,model_picker,index_picker,index_rate):
10
  gr.Warning("Your audio is being converted. Please wait.")
11
  now = datetime.now().strftime("%d%m%Y%H%M%S")
12
  index_files = glob.glob(f"logs/{index_picker}/*.index")
@@ -19,7 +19,7 @@ def convert(audio_picker,model_picker,index_picker,index_rate):
19
  command = [
20
  "python",
21
  "tools/infer_cli.py",
22
- "--f0up_key", "0",
23
  "--input_path", f"audios/{audio_picker}",
24
  "--index_path", index_files[0],
25
  "--f0method", "rmvpe",
@@ -148,9 +148,9 @@ def update_audio_player(choice):
148
  with gr.Blocks() as app:
149
  with gr.Row():
150
  with gr.Column():
151
- gr.HTML("<img src='file/a.png' alt='easy>")
152
  with gr.Column():
153
- gr.HTML("<a href='https://ko-fi.com/rejekts' target='_blank'><img src='file/kofi_button.png' alt='Support Me'></a>")
154
  with gr.Row():
155
  with gr.Column():
156
  with gr.Tabs():
@@ -168,6 +168,7 @@ with gr.Blocks() as app:
168
  download_button.click(fn=download_from_url,inputs=[url,model_rename],outputs=[url,model_picker])
169
  with gr.TabItem("Advanced"):
170
  index_rate = gr.Slider(label='Index Rate: ',minimum=0,maximum=1,value=0.66,step=0.01)
 
171
 
172
  with gr.Row():
173
  with gr.Tabs():
@@ -184,6 +185,6 @@ with gr.Blocks() as app:
184
  with gr.Row():
185
  audio_player = gr.Audio()
186
  audio_picker.change(fn=update_audio_player, inputs=[audio_picker],outputs=[audio_player])
187
- convert_button.click(convert, inputs=[audio_picker,model_picker,index_picker,index_rate],outputs=[audio_picker,audio_player])
188
 
189
  app.queue().launch()
 
6
  os.environ['index_root']="logs"
7
  os.environ['weight_root']="assets/weights"
8
 
9
+ def convert(audio_picker,model_picker,index_picker,index_rate,pitch):
10
  gr.Warning("Your audio is being converted. Please wait.")
11
  now = datetime.now().strftime("%d%m%Y%H%M%S")
12
  index_files = glob.glob(f"logs/{index_picker}/*.index")
 
19
  command = [
20
  "python",
21
  "tools/infer_cli.py",
22
+ "--f0up_key", str(pitch),
23
  "--input_path", f"audios/{audio_picker}",
24
  "--index_path", index_files[0],
25
  "--f0method", "rmvpe",
 
148
  with gr.Blocks() as app:
149
  with gr.Row():
150
  with gr.Column():
151
+ gr.HTML("<img src='./a.png' alt='easy>")
152
  with gr.Column():
153
+ gr.HTML("<a href='https://ko-fi.com/rejekts' target='_blank'><img src='./kofi_button.png' alt='Support Me'></a>")
154
  with gr.Row():
155
  with gr.Column():
156
  with gr.Tabs():
 
168
  download_button.click(fn=download_from_url,inputs=[url,model_rename],outputs=[url,model_picker])
169
  with gr.TabItem("Advanced"):
170
  index_rate = gr.Slider(label='Index Rate: ',minimum=0,maximum=1,value=0.66,step=0.01)
171
+ 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)
172
 
173
  with gr.Row():
174
  with gr.Tabs():
 
185
  with gr.Row():
186
  audio_player = gr.Audio()
187
  audio_picker.change(fn=update_audio_player, inputs=[audio_picker],outputs=[audio_player])
188
+ convert_button.click(convert, inputs=[audio_picker,model_picker,index_picker,index_rate,pitch],outputs=[audio_picker,audio_player])
189
 
190
  app.queue().launch()