Spaces:
Runtime error
Runtime error
Commit
·
45db1b7
1
Parent(s):
ecf4d28
Update app.py
Browse files
app.py
CHANGED
@@ -230,10 +230,10 @@ preload_models()
|
|
230 |
# Collect all existing speakers/voices in dir
|
231 |
speakers_list = []
|
232 |
|
233 |
-
for root, dirs, files in os.walk("./bark/assets/prompts
|
234 |
for file in files:
|
235 |
if(file.endswith(".npz")):
|
236 |
-
pathpart = root.replace("./bark/assets/prompts
|
237 |
# if len(pathpart) < 1:
|
238 |
# pathpart = "/"
|
239 |
speakers_list.append(os.path.join(pathpart, file[:-4]))
|
@@ -251,7 +251,7 @@ with gr.Blocks(title="Bark Enhanced Gradio GUI", mode="Bark Enhanced") as barkgu
|
|
251 |
placeholder = "Enter text here."
|
252 |
input_text = gr.Textbox(label="Input Text", lines=4, placeholder=placeholder)
|
253 |
with gr.Column():
|
254 |
-
convert_to_ssml_button = gr.Button("Convert Text to SSML")
|
255 |
with gr.Row():
|
256 |
with gr.Column():
|
257 |
examples = [
|
@@ -303,18 +303,19 @@ with gr.Blocks(title="Bark Enhanced Gradio GUI", mode="Bark Enhanced") as barkgu
|
|
303 |
tts_create_button = gr.Button("Create")
|
304 |
with gr.Column():
|
305 |
hidden_checkbox = gr.Checkbox(visible=False)
|
306 |
-
button_delete_files = gr.Button("Clear output folder")
|
307 |
with gr.Row():
|
308 |
output_audio = gr.Audio(label="Generated Audio", type="filepath")
|
309 |
|
310 |
with gr.Tab("Clone Voice"):
|
311 |
input_audio_filename = gr.Audio(label="Input audio.wav", source="upload", type="filepath")
|
312 |
transcription_text = gr.Textbox(label="Transcription Text", lines=1, placeholder="Enter Text of your Audio Sample here...")
|
313 |
-
initialname = "
|
314 |
#inputAudioFilename = gr.Textbox(label="Filename of Input Audio", lines=1, placeholder="audio.wav")
|
315 |
output_voice = gr.Textbox(label="Filename of trained Voice", lines=1, placeholder=initialname, value=initialname)
|
316 |
clone_voice_button = gr.Button("Create Voice")
|
317 |
dummy = gr.Text(label="Progress")
|
|
|
318 |
|
319 |
convert_to_ssml_button.click(convert_text_to_ssml, inputs=[input_text, speaker],outputs=input_text)
|
320 |
tts_create_button.click(generate_text_to_speech, inputs=[input_text, speaker, text_temp, waveform_temp, quick_gen_checkbox, complete_settings],outputs=output_audio)
|
@@ -322,6 +323,6 @@ with gr.Blocks(title="Bark Enhanced Gradio GUI", mode="Bark Enhanced") as barkgu
|
|
322 |
js = "(x) => confirm('Are you sure? This will remove all files from output folder')"
|
323 |
button_delete_files.click(None, None, hidden_checkbox, _js=js)
|
324 |
hidden_checkbox.change(delete_output_files, [hidden_checkbox], [hidden_checkbox])
|
325 |
-
clone_voice_button.click(clone_voice, inputs=[input_audio_filename, transcription_text, output_voice], outputs=dummy)
|
326 |
|
327 |
barkgui.queue().launch(show_error=True)
|
|
|
230 |
# Collect all existing speakers/voices in dir
|
231 |
speakers_list = []
|
232 |
|
233 |
+
for root, dirs, files in os.walk("./bark/assets/prompts"):
|
234 |
for file in files:
|
235 |
if(file.endswith(".npz")):
|
236 |
+
pathpart = root.replace("./bark/assets/prompts", "")
|
237 |
# if len(pathpart) < 1:
|
238 |
# pathpart = "/"
|
239 |
speakers_list.append(os.path.join(pathpart, file[:-4]))
|
|
|
251 |
placeholder = "Enter text here."
|
252 |
input_text = gr.Textbox(label="Input Text", lines=4, placeholder=placeholder)
|
253 |
with gr.Column():
|
254 |
+
convert_to_ssml_button = gr.Button("Convert Text to SSML", visible=False)
|
255 |
with gr.Row():
|
256 |
with gr.Column():
|
257 |
examples = [
|
|
|
303 |
tts_create_button = gr.Button("Create")
|
304 |
with gr.Column():
|
305 |
hidden_checkbox = gr.Checkbox(visible=False)
|
306 |
+
button_delete_files = gr.Button("Clear output folder", visible=False)
|
307 |
with gr.Row():
|
308 |
output_audio = gr.Audio(label="Generated Audio", type="filepath")
|
309 |
|
310 |
with gr.Tab("Clone Voice"):
|
311 |
input_audio_filename = gr.Audio(label="Input audio.wav", source="upload", type="filepath")
|
312 |
transcription_text = gr.Textbox(label="Transcription Text", lines=1, placeholder="Enter Text of your Audio Sample here...")
|
313 |
+
initialname = "Custom_voice"
|
314 |
#inputAudioFilename = gr.Textbox(label="Filename of Input Audio", lines=1, placeholder="audio.wav")
|
315 |
output_voice = gr.Textbox(label="Filename of trained Voice", lines=1, placeholder=initialname, value=initialname)
|
316 |
clone_voice_button = gr.Button("Create Voice")
|
317 |
dummy = gr.Text(label="Progress")
|
318 |
+
npz_file_1 = gr.File(label=".npz file")
|
319 |
|
320 |
convert_to_ssml_button.click(convert_text_to_ssml, inputs=[input_text, speaker],outputs=input_text)
|
321 |
tts_create_button.click(generate_text_to_speech, inputs=[input_text, speaker, text_temp, waveform_temp, quick_gen_checkbox, complete_settings],outputs=output_audio)
|
|
|
323 |
js = "(x) => confirm('Are you sure? This will remove all files from output folder')"
|
324 |
button_delete_files.click(None, None, hidden_checkbox, _js=js)
|
325 |
hidden_checkbox.change(delete_output_files, [hidden_checkbox], [hidden_checkbox])
|
326 |
+
clone_voice_button.click(clone_voice, inputs=[input_audio_filename, transcription_text, output_voice], outputs=[dummy,npz_file_1])
|
327 |
|
328 |
barkgui.queue().launch(show_error=True)
|