NeoPy commited on
Commit
bcbd1f5
·
verified ·
1 Parent(s): 393de01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -240,6 +240,7 @@ def run(
240
  raise ValueError("The model file must be a .pth file")
241
 
242
 
 
243
  print("Random tag:", random_tag)
244
  print("File model:", file_m)
245
  print("Pitch algorithm:", pitch_alg)
@@ -274,18 +275,20 @@ def upload_model(index_file, pth_file, model_name):
274
  MODELS.append({"model": pth_file, "index": index_file, "model_name": model_name})
275
  return "Uploaded!"
276
 
277
- with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose"), title="Ilaria RVC 💖") as app:
278
- gr.Markdown("## Ilaria RVC 💖")
 
 
279
  gr.Markdown("**Help keeping up the GPU donating on [Ko-Fi](https://ko-fi.com/ilariaowo)**")
280
  with gr.Tab("Inference"):
281
  sound_gui = gr.Audio(value=None,type="filepath",autoplay=False,visible=True,)
282
  def update():
283
  print(MODELS)
284
  return gr.Dropdown(label="Model",choices=[model["model_name"] for model in MODELS],visible=True,interactive=True, value=MODELS[0]["model_name"],)
285
- with gr.Row():
286
  models_dropdown = gr.Dropdown(label="Model",choices=[model["model_name"] for model in MODELS],visible=True,interactive=True, value=MODELS[0]["model_name"],)
287
  refresh_button = gr.Button("Refresh Models")
288
- refresh_button.click(update, outputs=[models_dropdown])
289
 
290
  with gr.Accordion("Ilaria TTS", open=False):
291
  text_tts = gr.Textbox(label="Text", placeholder="Hello!", lines=3, interactive=True,)
@@ -295,15 +298,18 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
295
  button_tts.click(text_to_speech_edge, inputs=[text_tts, dropdown_tts], outputs=[sound_gui])
296
 
297
  with gr.Accordion("Settings", open=False):
298
- pitch_algo_conf = gr.Dropdown(PITCH_ALGO_OPT,value=PITCH_ALGO_OPT[4],label="Pitch algorithm",visible=True,interactive=True,)
299
- pitch_lvl_conf = gr.Slider(label="Pitch level (lower -> 'male' while higher -> 'female')",minimum=-24,maximum=24,step=1,value=0,visible=True,interactive=True,)
300
- index_inf_conf = gr.Slider(minimum=0,maximum=1,label="Index influence -> How much accent is applied",value=0.75,)
301
- respiration_filter_conf = gr.Slider(minimum=0,maximum=7,label="Respiration median filtering",value=3,step=1,interactive=True,)
302
- envelope_ratio_conf = gr.Slider(minimum=0,maximum=1,label="Envelope ratio",value=0.25,interactive=True,)
 
 
303
  consonant_protec_conf = gr.Slider(minimum=0,maximum=0.5,label="Consonant breath protection",value=0.5,interactive=True,)
304
 
305
- button_conf = gr.Button("Convert",variant="primary",)
306
- output_conf = gr.Audio(type="filepath",label="Output",)
 
307
 
308
  button_conf.click(lambda :None, None, output_conf)
309
  button_conf.click(
 
240
  raise ValueError("The model file must be a .pth file")
241
 
242
 
243
+ print("ILARIA RVC: mod by NeoDev 💖")
244
  print("Random tag:", random_tag)
245
  print("File model:", file_m)
246
  print("Pitch algorithm:", pitch_alg)
 
275
  MODELS.append({"model": pth_file, "index": index_file, "model_name": model_name})
276
  return "Uploaded!"
277
 
278
+
279
+
280
+ with gr.Blocks(theme=gr.themes.Base(primary_hue="pink", secondary_hue="rose"), title="Ilaria RVC 💖") as app:
281
+ gr.Markdown("# Ilaria RVC 💖")
282
  gr.Markdown("**Help keeping up the GPU donating on [Ko-Fi](https://ko-fi.com/ilariaowo)**")
283
  with gr.Tab("Inference"):
284
  sound_gui = gr.Audio(value=None,type="filepath",autoplay=False,visible=True,)
285
  def update():
286
  print(MODELS)
287
  return gr.Dropdown(label="Model",choices=[model["model_name"] for model in MODELS],visible=True,interactive=True, value=MODELS[0]["model_name"],)
288
+ with gr.Row(equal_height=True):
289
  models_dropdown = gr.Dropdown(label="Model",choices=[model["model_name"] for model in MODELS],visible=True,interactive=True, value=MODELS[0]["model_name"],)
290
  refresh_button = gr.Button("Refresh Models")
291
+ refresh_button.click(update, outputs=[models_dropdown])
292
 
293
  with gr.Accordion("Ilaria TTS", open=False):
294
  text_tts = gr.Textbox(label="Text", placeholder="Hello!", lines=3, interactive=True,)
 
298
  button_tts.click(text_to_speech_edge, inputs=[text_tts, dropdown_tts], outputs=[sound_gui])
299
 
300
  with gr.Accordion("Settings", open=False):
301
+ pitch_algo_conf = gr.Radio(choise=PITCH_ALGO_OPT,value=PITCH_ALGO_OPT[4],label="Pitch algorithm",visible=True,interactive=True) # Dropdown is 🤡
302
+ with gr.Rowe(equal_height=True):
303
+ pitch_lvl_conf = gr.Slider(label="Pitch level (lower -> 'male' while higher -> 'female')",minimum=-24,maximum=24,step=1,value=0,visible=True,interactive=True,)
304
+ index_inf_conf = gr.Slider(minimum=0,maximum=1,label="Index influence -> How much accent is applied",value=0.75,)
305
+ with gr.Row(equal_height=True):
306
+ respiration_filter_conf = gr.Slider(minimum=0,maximum=7,label="Respiration median filtering",value=3,step=1,interactive=True,)
307
+ envelope_ratio_conf = gr.Slider(minimum=0,maximum=1,label="Envelope ratio",value=0.25,interactive=True,)
308
  consonant_protec_conf = gr.Slider(minimum=0,maximum=0.5,label="Consonant breath protection",value=0.5,interactive=True,)
309
 
310
+ with gr.Row(equal_height=True):
311
+ button_conf = gr.Button("Convert",variant="primary",)
312
+ output_conf = gr.Audio(type="filepath",label="Output",)
313
 
314
  button_conf.click(lambda :None, None, output_conf)
315
  button_conf.click(