Skip to content

Commit d08c5b4

Browse files
committed
added refinegan pretrain download, re-enabled selection on training UI, adjusted training UI defaults
1 parent 1ad29ca commit d08c5b4

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

rvc/lib/tools/prerequisites_download.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616
"f0G40k.pth",
1717
"f0G48k.pth",
1818
],
19-
)
19+
),
20+
]
21+
pretraineds_refinegan_list = [
22+
(
23+
"refinegan/",
24+
[
25+
"f0D32k.pth",
26+
"f0G32k.pth",
27+
],
28+
),
2029
]
2130
models_list = [("predictors/", ["rmvpe.pt", "fcpe.pt"])]
2231
embedders_list = [("embedders/contentvec/", ["pytorch_model.bin", "config.json"])]
@@ -26,6 +35,7 @@
2635

2736
folder_mapping_list = {
2837
"pretrained_v2/": "rvc/models/pretraineds/hifi-gan/",
38+
"refinegan/": "rvc/models/pretraineds/refinegan/",
2939
"embedders/contentvec/": "rvc/models/embedders/contentvec/",
3040
"predictors/": "rvc/models/predictors/",
3141
"formant/": "rvc/models/formant/",
@@ -118,6 +128,7 @@ def calculate_total_size(
118128
if exe and os.name == "nt":
119129
total_size += get_file_size_if_missing(executables_list)
120130
total_size += get_file_size_if_missing(pretraineds_hifigan)
131+
total_size += get_file_size_if_missing(pretraineds_refinegan_list)
121132
return total_size
122133

123134

@@ -149,5 +160,6 @@ def prequisites_download_pipeline(
149160
print("No executables needed")
150161
if pretraineds_hifigan:
151162
download_mapping_files(pretraineds_hifigan_list, global_bar)
163+
download_mapping_files(pretraineds_refinegan_list, global_bar)
152164
else:
153165
pass

rvc/train/train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
bf16_adamw = False
7171
disc_version = "v2"
7272

73+
if vocoder == "RefineGAN":
74+
disc_version = "v3"
75+
multiscale_mel_loss = True
76+
7377
current_dir = os.getcwd()
7478

7579
try:

tabs/train/train.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def train_tab():
328328
choices=["RVC", "Applio"],
329329
value="RVC",
330330
interactive=True,
331-
visible=False, # to be visible once pretraineds are ready
331+
visible=False,
332332
)
333333
with gr.Column():
334334
sampling_rate = gr.Radio(
@@ -343,10 +343,10 @@ def train_tab():
343343
info=i18n(
344344
"Choose the vocoder for audio synthesis:\n- **HiFi-GAN**: Default option, compatible with all clients.\n- **MRF HiFi-GAN**: Higher fidelity, Applio-only.\n- **RefineGAN**: Superior audio quality, Applio-only."
345345
),
346-
choices=["HiFi-GAN", "MRF HiFi-GAN", "RefineGAN"],
346+
choices=["HiFi-GAN", "RefineGAN"], #"MRF HiFi-GAN", ],
347347
value="HiFi-GAN",
348-
interactive=False,
349-
visible=False, # to be visible once pretraineds are ready
348+
interactive=True,
349+
visible=True,
350350
)
351351
with gr.Accordion(
352352
i18n("Advanced Settings"),
@@ -451,7 +451,7 @@ def train_tab():
451451
info=i18n(
452452
"It's recommended to deactivate this option if your dataset has already been processed."
453453
),
454-
value=True,
454+
value=False,
455455
interactive=True,
456456
visible=True,
457457
)
@@ -462,7 +462,7 @@ def train_tab():
462462
"Audio normalization: Select 'none' if the files are already normalized, 'pre' to normalize the entire input file at once, or 'post' to normalize each slice individually."
463463
),
464464
choices=["none", "pre", "post"],
465-
value="none",
465+
value="post",
466466
interactive=True,
467467
visible=True,
468468
)

0 commit comments

Comments
 (0)