oItsMineZ commited on
Commit
d724c5c
·
verified ·
1 Parent(s): aaa6efa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -32
app.py CHANGED
@@ -982,20 +982,14 @@ def GradioSetup(UTheme=gr.themes.Soft()):
982
  ],
983
  [vc_output1, vc_output2],
984
  )
985
- with gr.TabItem(i18n("Batch")): # Dont Change
986
  with gr.Group(): # Markdown explanation of batch inference
987
- gr.Markdown(
988
- value=i18n("Batch conversion. Enter the folder containing the audio files to be converted or upload multiple audio files. The converted audio will be output in the specified folder (default: 'opt').")
989
- )
990
  with gr.Row():
991
  with gr.Column():
992
- vc_transform1 = gr.Number(
993
- label=i18n("Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12):"), value=0
994
- )
995
- opt_input = gr.Textbox(label=i18n("Specify output folder:"), value="opt")
996
  with gr.Column():
997
  file_index4 = gr.Dropdown(
998
- label=i18n("Auto-detect index path and select from the dropdown:"),
999
  choices=get_indexes(),
1000
  value=best_match_index_path1,
1001
  interactive=True,
@@ -1010,42 +1004,32 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1010
  index_rate2 = gr.Slider(
1011
  minimum=0,
1012
  maximum=1,
1013
- label=i18n("Search feature ratio:"),
1014
  value=0.75,
1015
  interactive=True,
1016
  )
1017
  with gr.Row():
1018
  dir_input = gr.Textbox(
1019
- label=i18n("Enter the path of the audio folder to be processed (copy it from the address bar of the file manager):"),
1020
  value=os.path.join(now_dir, "audios"),
1021
  )
1022
- inputs = gr.File(
1023
- file_count="multiple", label=i18n("You can also input audio files in batches. Choose one of the two options. Priority is given to reading from the folder.")
1024
- )
1025
 
1026
  with gr.Row():
1027
  with gr.Column():
1028
- # Create a checkbox for advanced batch settings
1029
  advanced_settings_batch_checkbox = gr.Checkbox(
1030
  value=False,
1031
- label=i18n("Advanced Settings"),
1032
  interactive=True,
1033
  )
1034
 
1035
  # Advanced batch settings container
1036
  with gr.Row(visible=False) as advanced_settings_batch: # Initially hidden
1037
- with gr.Row(label = i18n("Advanced Settings"), open = False):
1038
  with gr.Column():
1039
  file_index3 = gr.Textbox(
1040
- label=i18n("Feature search database file path:"),
1041
  value="",
1042
  interactive=True,
1043
  )
1044
 
1045
  f0method1 = gr.Radio(
1046
- label=i18n(
1047
- "Select the pitch extraction algorithm:"
1048
- ),
1049
  choices=["pm", "harvest", "crepe", "rmvpe"],
1050
  value="rmvpe",
1051
  interactive=True,
@@ -1057,7 +1041,6 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1057
  filter_radius1 = gr.Slider(
1058
  minimum=0,
1059
  maximum=7,
1060
- label=i18n("If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness."),
1061
  value=3,
1062
  step=1,
1063
  interactive=True,
@@ -1065,7 +1048,6 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1065
 
1066
  with gr.Row():
1067
  format1 = gr.Radio(
1068
- label=i18n("Export file format"),
1069
  choices=["wav", "flac", "mp3", "m4a"],
1070
  value="wav",
1071
  interactive=True,
@@ -1076,7 +1058,6 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1076
  resample_sr1 = gr.Slider(
1077
  minimum=0,
1078
  maximum=48000,
1079
- label=i18n("Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling:"),
1080
  value=0,
1081
  step=1,
1082
  interactive=True,
@@ -1084,22 +1065,18 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1084
  rms_mix_rate1 = gr.Slider(
1085
  minimum=0,
1086
  maximum=1,
1087
- label=i18n("Use the volume envelope of the input to replace or mix with the volume envelope of the output. The closer the ratio is to 1, the more the output envelope is used:"),
1088
  value=1,
1089
  interactive=True,
1090
  )
1091
  protect1 = gr.Slider(
1092
  minimum=0,
1093
  maximum=0.5,
1094
- label=i18n(
1095
- "Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy:"
1096
- ),
1097
  value=0.33,
1098
  step=0.01,
1099
  interactive=True,
1100
  )
1101
- vc_output3 = gr.Textbox(label=i18n("Output information:"))
1102
- but1 = gr.Button(i18n("Convert"), variant="primary")
1103
  but1.click(
1104
  vc.vc_multi,
1105
  [
@@ -1133,7 +1110,6 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1133
  if not sid0.value == '':
1134
  spk_item, protect0, protect1 = vc.get_vc(sid0.value, protect0, protect1)
1135
 
1136
- #spk_item, protect0, protect1 = vc.get_vc(sid0.value, protect0, protect1)
1137
 
1138
  # Function to toggle advanced settings
1139
  def toggle_advanced_settings_batch(checkbox):
@@ -1146,7 +1122,6 @@ def GradioSetup(UTheme=gr.themes.Soft()):
1146
  outputs=[advanced_settings_batch]
1147
  )
1148
 
1149
-
1150
  with gr.Accordion(label="f0method8", visible=False): #Don't Remove
1151
  with gr.Row():
1152
  with gr.Column():
 
982
  ],
983
  [vc_output1, vc_output2],
984
  )
985
+
986
  with gr.Group(): # Markdown explanation of batch inference
 
 
 
987
  with gr.Row():
988
  with gr.Column():
989
+ vc_transform1 = gr.Number(value=0)
990
+ opt_input = gr.Textbox(value="opt")
 
 
991
  with gr.Column():
992
  file_index4 = gr.Dropdown(
 
993
  choices=get_indexes(),
994
  value=best_match_index_path1,
995
  interactive=True,
 
1004
  index_rate2 = gr.Slider(
1005
  minimum=0,
1006
  maximum=1,
 
1007
  value=0.75,
1008
  interactive=True,
1009
  )
1010
  with gr.Row():
1011
  dir_input = gr.Textbox(
 
1012
  value=os.path.join(now_dir, "audios"),
1013
  )
1014
+ inputs = gr.File(file_count="multiple")
 
 
1015
 
1016
  with gr.Row():
1017
  with gr.Column():
 
1018
  advanced_settings_batch_checkbox = gr.Checkbox(
1019
  value=False,
 
1020
  interactive=True,
1021
  )
1022
 
1023
  # Advanced batch settings container
1024
  with gr.Row(visible=False) as advanced_settings_batch: # Initially hidden
1025
+ with gr.Row(label = "Advanced Settings", open = False):
1026
  with gr.Column():
1027
  file_index3 = gr.Textbox(
 
1028
  value="",
1029
  interactive=True,
1030
  )
1031
 
1032
  f0method1 = gr.Radio(
 
 
 
1033
  choices=["pm", "harvest", "crepe", "rmvpe"],
1034
  value="rmvpe",
1035
  interactive=True,
 
1041
  filter_radius1 = gr.Slider(
1042
  minimum=0,
1043
  maximum=7,
 
1044
  value=3,
1045
  step=1,
1046
  interactive=True,
 
1048
 
1049
  with gr.Row():
1050
  format1 = gr.Radio(
 
1051
  choices=["wav", "flac", "mp3", "m4a"],
1052
  value="wav",
1053
  interactive=True,
 
1058
  resample_sr1 = gr.Slider(
1059
  minimum=0,
1060
  maximum=48000,
 
1061
  value=0,
1062
  step=1,
1063
  interactive=True,
 
1065
  rms_mix_rate1 = gr.Slider(
1066
  minimum=0,
1067
  maximum=1,
 
1068
  value=1,
1069
  interactive=True,
1070
  )
1071
  protect1 = gr.Slider(
1072
  minimum=0,
1073
  maximum=0.5,
 
 
 
1074
  value=0.33,
1075
  step=0.01,
1076
  interactive=True,
1077
  )
1078
+ vc_output3 = gr.Textbox(label="Output information:")
1079
+ but1 = gr.Button("Convert", variant="primary")
1080
  but1.click(
1081
  vc.vc_multi,
1082
  [
 
1110
  if not sid0.value == '':
1111
  spk_item, protect0, protect1 = vc.get_vc(sid0.value, protect0, protect1)
1112
 
 
1113
 
1114
  # Function to toggle advanced settings
1115
  def toggle_advanced_settings_batch(checkbox):
 
1122
  outputs=[advanced_settings_batch]
1123
  )
1124
 
 
1125
  with gr.Accordion(label="f0method8", visible=False): #Don't Remove
1126
  with gr.Row():
1127
  with gr.Column():