forked from mrq/ai-voice-cloning
some cleanup
This commit is contained in:
parent
5460e191b0
commit
2f6dd9c076
28
src/webui.py
28
src/webui.py
|
@ -171,8 +171,14 @@ def read_generate_settings_proxy(file, saveAs='.temp'):
|
||||||
gr.update(visible=j is not None),
|
gr.update(visible=j is not None),
|
||||||
)
|
)
|
||||||
|
|
||||||
def prepare_dataset_proxy( voice, language, skip_existings, progress=gr.Progress(track_tqdm=True) ):
|
def prepare_dataset_proxy( voice, language, validation_size, skip_existings, progress=gr.Progress(track_tqdm=True) ):
|
||||||
return prepare_dataset( get_voices(load_latents=False)[voice], outdir=f"./training/{voice}/", language=language, skip_existings=skip_existings, progress=progress )
|
messages = []
|
||||||
|
message = prepare_dataset( get_voices(load_latents=False)[voice], outdir=f"./training/{voice}/", language=language, skip_existings=skip_existings, progress=progress )
|
||||||
|
messages.append(message)
|
||||||
|
if validation_size > 0:
|
||||||
|
message = prepare_validation_dataset( voice, text_length=validation_size )
|
||||||
|
messages.append(message)
|
||||||
|
return "\n".join(messages)
|
||||||
|
|
||||||
def update_args_proxy( *args ):
|
def update_args_proxy( *args ):
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
@ -377,14 +383,18 @@ def setup_gradio():
|
||||||
with gr.Tab("Prepare Dataset"):
|
with gr.Tab("Prepare Dataset"):
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
with gr.Column():
|
with gr.Column():
|
||||||
dataset_settings = [
|
DATASET_SETTINGS = {}
|
||||||
gr.Dropdown( choices=voice_list, label="Dataset Source", type="value", value=voice_list[0] if len(voice_list) > 0 else "" ),
|
DATASET_SETTINGS['voice'] = gr.Dropdown( choices=voice_list, label="Dataset Source", type="value", value=voice_list[0] if len(voice_list) > 0 else "" )
|
||||||
gr.Textbox(label="Language", value="en"),
|
with gr.Row():
|
||||||
gr.Checkbox(label="Skip Already Transcribed", value=False)
|
DATASET_SETTINGS['language'] = gr.Textbox(label="Language", value="en")
|
||||||
]
|
DATASET_SETTINGS['validation_size'] = gr.Number(label="Validation Text Length Cull Size", value=12, precision=0)
|
||||||
|
DATASET_SETTINGS['skip'] = gr.Checkbox(label="Skip Already Transcribed", value=False)
|
||||||
|
|
||||||
|
with gr.Row():
|
||||||
transcribe_button = gr.Button(value="Transcribe")
|
transcribe_button = gr.Button(value="Transcribe")
|
||||||
validation_text_cull_size = gr.Number(label="Validation Text Length Cull Size", value=12, precision=0)
|
|
||||||
prepare_validation_button = gr.Button(value="Prepare Validation")
|
prepare_validation_button = gr.Button(value="Prepare Validation")
|
||||||
|
|
||||||
|
dataset_settings = list(DATASET_SETTINGS.values())
|
||||||
with gr.Column():
|
with gr.Column():
|
||||||
prepare_dataset_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
|
prepare_dataset_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
|
||||||
with gr.Tab("Generate Configuration"):
|
with gr.Tab("Generate Configuration"):
|
||||||
|
@ -692,7 +702,7 @@ def setup_gradio():
|
||||||
prepare_validation_dataset,
|
prepare_validation_dataset,
|
||||||
inputs=[
|
inputs=[
|
||||||
dataset_settings[0],
|
dataset_settings[0],
|
||||||
validation_text_cull_size,
|
DATASET_SETTINGS['validation_size'],
|
||||||
],
|
],
|
||||||
outputs=prepare_dataset_output #console_output
|
outputs=prepare_dataset_output #console_output
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user