Skip to content

Commit

Permalink
new arch selector
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Dec 23, 2024
1 parent f935143 commit 1c1aeed
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
5 changes: 3 additions & 2 deletions assets/i18n/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"Enter dataset path": "Enter dataset path",
"Sampling Rate": "Sampling Rate",
"The sampling rate of the audio files.": "The sampling rate of the audio files.",
"Model Architecture": "Model Architecture",
"Architecture": "Architecture",
"Version of the model architecture.": "Version of the model architecture.",
"Preprocess Dataset": "Preprocess Dataset",
"Embedder Model": "Embedder Model",
Expand Down Expand Up @@ -322,7 +322,8 @@
"The name that will appear in the model information.": "The name that will appear in the model information.",
"Set name": "Set name",
"Vocoder": "Vocoder",
"Vocoder for audio synthesis: HiFi-GAN (default, available for all clients), MRF HiFi-GAN (higher fidelity, Applio-only), or RefineGAN (offering superior audio quality, Applio-only).": "Vocoder for audio synthesis: HiFi-GAN (default, available for all clients), MRF HiFi-GAN (higher fidelity, Applio-only), or RefineGAN (offering superior audio quality, Applio-only).",
"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.": "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.",
"Choose the model architecture:\n- **RVC (V2)**: Default option, compatible with all clients.\n- **Applio**: Advanced quality with improved vocoders and higher sample rates, Applio-only.": "Choose the model architecture:\n- **RVC (V2)**: Default option, compatible with all clients.\n- **Applio**: Advanced quality with improved vocoders and higher sample rates, Applio-only.",
"Checkpointing": "Checkpointing",
"Enables memory-efficient training. This reduces VRAM usage at the cost of slower training speed. It is useful for GPUs with limited memory (e.g., <6GB VRAM) or when training with a batch size larger than what your GPU can normally accommodate.": "Enables memory-efficient training. This reduces VRAM usage at the cost of slower training speed. It is useful for GPUs with limited memory (e.g., <6GB VRAM) or when training with a batch size larger than what your GPU can normally accommodate.",
"Enable Experimental Options": "Enable Experimental Options",
Expand Down
47 changes: 29 additions & 18 deletions tabs/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ def train_tab():
interactive=True,
allow_custom_value=True,
)
experimental_options = gr.Checkbox(
label=i18n("Enable Experimental Options"),
architecture = gr.Radio(
label=i18n("Architecture"),
info=i18n(
"Enable extra features like 44100 sample rate and vocoder selection. These may cause errors and lack pretrained models."
"Choose the model architecture:\n- **RVC (V2)**: Default option, compatible with all clients.\n- **Applio**: Advanced quality with improved vocoders and higher sample rates, Applio-only."
),
value=False,
choices=["RVC", "Applio"],
value="RVC",
interactive=True,
visible=True,
)

with gr.Column():
sampling_rate = gr.Radio(
label=i18n("Sampling Rate"),
Expand All @@ -333,12 +335,12 @@ def train_tab():
vocoder = gr.Radio(
label=i18n("Vocoder"),
info=i18n(
"Vocoder for audio synthesis: HiFi-GAN (default, available for all clients), MRF HiFi-GAN (higher fidelity, Applio-only), or RefineGAN (offering superior audio quality, Applio-only)."
"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."
),
choices=["HiFi-GAN", "MRF HiFi-GAN", "RefineGAN"],
value="HiFi-GAN",
interactive=True,
visible=False,
interactive=False,
visible=True,
)
rvc_version = gr.Radio(
label=i18n("Model Architecture"),
Expand Down Expand Up @@ -937,16 +939,25 @@ def toggle_visible_embedder_custom(embedder_model):
return {"visible": True, "__type__": "update"}
return {"visible": False, "__type__": "update"}

def toggle_experimental(enabled):
if enabled:
def toggle_architecture(architecture):
if architecture == "Applio":
return {
"choices": ["32000", "40000", "44100", "48000"],
"__type__": "update",
}, {"visible": True, "__type__": "update"}
return {"choices": ["32000", "40000", "48000"], "__type__": "update"}, {
"visible": False,
"__type__": "update",
}
}, {
"interactive": True,
"__type__": "update",
}
else:
return {
"choices": ["32000", "40000", "48000"],
"__type__": "update",
"value": "40000"
}, {
"interactive": False,
"__type__": "update",
"value": "HiFi-GAN"
}

def update_slider_visibility(noise_reduction):
return gr.update(visible=noise_reduction)
Expand All @@ -961,9 +972,9 @@ def update_slider_visibility(noise_reduction):
inputs=[rvc_version],
outputs=[],
)
experimental_options.change(
fn=toggle_experimental,
inputs=[experimental_options],
architecture.change(
fn=toggle_architecture,
inputs=[architecture],
outputs=[sampling_rate, vocoder],
)
refresh.click(
Expand Down

0 comments on commit 1c1aeed

Please sign in to comment.