kevinwang676 commited on
Commit
20728ab
1 Parent(s): 96971bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -53
app.py CHANGED
@@ -296,7 +296,7 @@ while run_server:
296
  with gr.Blocks(title=f"{APPTITLE}", mode=f"{APPTITLE}", theme=settings.selected_theme) as barkgui:
297
  with gr.Row():
298
  with gr.Column():
299
- gr.Markdown(f"### [{APPTITLE}](https://github.com/C0untFloyd/bark-gui)")
300
  with gr.Column():
301
  gr.HTML(create_version_html(), elem_id="versions")
302
 
@@ -392,66 +392,17 @@ while run_server:
392
  with gr.Row():
393
  output_swap = gr.Audio(label="Generated Audio", type="filepath")
394
 
395
- with gr.Tab("Training Data Prepare"):
396
- gr.Markdown("This tab should be used to generate the training dataset. For Step 1 put some books into the inputtext folder in UTF-8 Text Format.")
397
- prepare_semantics_number = gr.Number(label="Number of semantics to create", precision=0, value=3079)
398
- prepare_dropdown = gr.Dropdown(prepare_training_list, value=prepare_training_list[0], label="Prepare")
399
- training_prepare_button = gr.Button("Generate")
400
- dummytrd = gr.Text(label="Progress")
401
-
402
- with gr.Tab("Training"):
403
- with gr.Row():
404
- gr.Markdown("This tab is used to train the actual model (language).")
405
- with gr.Row():
406
- with gr.Column():
407
- save_model_epoch = gr.Number(label="Auto-save model after number of epochs", precision=0, value=1)
408
- with gr.Column():
409
- max_epochs = gr.Number(label="Train for number of epochs", precision=0, value=6)
410
- with gr.Row():
411
- with gr.Column():
412
- allowed_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=\"\':;[]{}/<>,.`~'
413
- allowedcharsfilter = gr.Textbox(label="Allowed chars for text input", lines=1, value=allowed_chars)
414
- with gr.Column():
415
- train_button = gr.Button("Start Training")
416
- with gr.Row():
417
- dummytrain = gr.Text(label="Progress")
418
-
419
-
420
- with gr.Tab("Settings"):
421
- with gr.Row():
422
- themes = gr.Dropdown(available_themes, label="Theme", info="Change needs complete restart", value=settings.selected_theme)
423
- with gr.Row():
424
- input_server_name = gr.Textbox(label="Server Name", lines=1, info="Leave blank to run locally", value=settings.server_name)
425
- input_server_port = gr.Number(label="Server Port", precision=0, info="Leave at 0 to use default", value=settings.server_port)
426
- share_checkbox = gr.Checkbox(label="Public Server", value=settings.server_share)
427
- with gr.Row():
428
- input_desired_len = gr.Slider(100, 150, value=settings.input_text_desired_length, label="Desired Input Text Length", info="Ideal length to split input sentences")
429
- input_max_len = gr.Slider(150, 256, value=settings.input_text_max_length, label="Max Input Text Length", info="Maximum Input Text Length")
430
- with gr.Row():
431
- input_silence_break = gr.Slider(1, 1000, value=settings.silence_sentence, label="Sentence Pause Time (ms)", info="Silence between sentences in milliseconds")
432
- input_silence_speakers = gr.Slider(1, 5000, value=settings.silence_speakers, label="Speaker Pause Time (ms)", info="Silence between different speakers in milliseconds")
433
-
434
- with gr.Row():
435
- button_apply_settings = gr.Button("Apply Settings")
436
- button_apply_restart = gr.Button("Restart Server")
437
- button_delete_files = gr.Button("Clear output folder")
438
-
439
  quick_gen_checkbox.change(fn=on_quick_gen_changed, inputs=quick_gen_checkbox, outputs=complete_settings)
440
  convert_to_ssml_button.click(convert_text_to_ssml, inputs=[input_text, speaker],outputs=input_text)
441
  gen_click = tts_create_button.click(generate_text_to_speech, inputs=[input_text, speaker, text_temp, waveform_temp, eos_prob, quick_gen_checkbox, complete_settings, seedcomponent, batchcount],outputs=output_audio)
442
  button_stop_generation.click(fn=None, inputs=None, outputs=None, cancels=[gen_click])
443
 
444
- # Javascript hack to display modal confirmation dialog
445
- js = "(x) => confirm('Are you sure? This will remove all files from output folder')"
446
- button_delete_files.click(None, None, hidden_checkbox, _js=js)
447
- hidden_checkbox.change(delete_output_files, [hidden_checkbox], [hidden_checkbox])
448
 
449
  swap_voice_button.click(swap_voice_from_audio, inputs=[swap_audio_filename, speaker_swap, swap_tokenizer_lang, swap_seed, swap_batchcount], outputs=output_swap)
450
  clone_voice_button.click(clone_voice, inputs=[input_audio_filename, output_voice], outputs=[dummy, npz_file])
451
- training_prepare_button.click(training_prepare, inputs=[prepare_dropdown, prepare_semantics_number], outputs=dummytrd)
452
- train_button.click(start_training, inputs=[save_model_epoch, max_epochs], outputs=dummytrain)
453
- button_apply_settings.click(apply_settings, inputs=[themes, input_server_name, input_server_port, share_checkbox, input_desired_len, input_max_len, input_silence_break, input_silence_speakers])
454
- button_apply_restart.click(restart)
455
 
456
  restart_server = False
457
  try:
 
296
  with gr.Blocks(title=f"{APPTITLE}", mode=f"{APPTITLE}", theme=settings.selected_theme) as barkgui:
297
  with gr.Row():
298
  with gr.Column():
299
+ gr.Markdown(f"### [{APPTITLE}](https://github.com/KevinWang676/Bark-Voice-Cloning)")
300
  with gr.Column():
301
  gr.HTML(create_version_html(), elem_id="versions")
302
 
 
392
  with gr.Row():
393
  output_swap = gr.Audio(label="Generated Audio", type="filepath")
394
 
395
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  quick_gen_checkbox.change(fn=on_quick_gen_changed, inputs=quick_gen_checkbox, outputs=complete_settings)
397
  convert_to_ssml_button.click(convert_text_to_ssml, inputs=[input_text, speaker],outputs=input_text)
398
  gen_click = tts_create_button.click(generate_text_to_speech, inputs=[input_text, speaker, text_temp, waveform_temp, eos_prob, quick_gen_checkbox, complete_settings, seedcomponent, batchcount],outputs=output_audio)
399
  button_stop_generation.click(fn=None, inputs=None, outputs=None, cancels=[gen_click])
400
 
401
+
 
 
 
402
 
403
  swap_voice_button.click(swap_voice_from_audio, inputs=[swap_audio_filename, speaker_swap, swap_tokenizer_lang, swap_seed, swap_batchcount], outputs=output_swap)
404
  clone_voice_button.click(clone_voice, inputs=[input_audio_filename, output_voice], outputs=[dummy, npz_file])
405
+
 
 
 
406
 
407
  restart_server = False
408
  try: