Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -441,47 +441,6 @@ with gr.Blocks() as app_tts:
|
|
441 |
outputs=[audio_output, spectrogram_output],
|
442 |
)
|
443 |
|
444 |
-
with gr.Blocks() as app_podcast:
|
445 |
-
gr.Markdown("# Podcast Generation")
|
446 |
-
speaker1_name = gr.Textbox(label="Speaker 1 Name")
|
447 |
-
ref_audio_input1 = gr.Audio(label="Reference Audio (Speaker 1)", type="filepath")
|
448 |
-
ref_text_input1 = gr.Textbox(label="Reference Text (Speaker 1)", lines=2)
|
449 |
-
|
450 |
-
speaker2_name = gr.Textbox(label="Speaker 2 Name")
|
451 |
-
ref_audio_input2 = gr.Audio(label="Reference Audio (Speaker 2)", type="filepath")
|
452 |
-
ref_text_input2 = gr.Textbox(label="Reference Text (Speaker 2)", lines=2)
|
453 |
-
|
454 |
-
script_input = gr.Textbox(label="Podcast Script", lines=10,
|
455 |
-
placeholder="Enter the script with speaker names at the start of each block, e.g.:\nSean: How did you start studying...\n\nMeghan: I came to my interest in technology...\nIt was a long journey...\n\nSean: That's fascinating. Can you elaborate...")
|
456 |
-
|
457 |
-
podcast_model_choice = gr.Radio(
|
458 |
-
choices=["F5-TTS"], label="Choose TTS Model", value="F5-TTS"
|
459 |
-
)
|
460 |
-
podcast_remove_silence = gr.Checkbox(
|
461 |
-
label="Remove Silences",
|
462 |
-
value=True,
|
463 |
-
)
|
464 |
-
generate_podcast_btn = gr.Button("Generate Podcast", variant="primary")
|
465 |
-
podcast_output = gr.Audio(label="Generated Podcast")
|
466 |
-
|
467 |
-
def podcast_generation(script, speaker1, ref_audio1, ref_text1, speaker2, ref_audio2, ref_text2, model, remove_silence):
|
468 |
-
return generate_podcast(script, speaker1, ref_audio1, ref_text1, speaker2, ref_audio2, ref_text2, model, remove_silence)
|
469 |
-
|
470 |
-
generate_podcast_btn.click(
|
471 |
-
podcast_generation,
|
472 |
-
inputs=[
|
473 |
-
script_input,
|
474 |
-
speaker1_name,
|
475 |
-
ref_audio_input1,
|
476 |
-
ref_text_input1,
|
477 |
-
speaker2_name,
|
478 |
-
ref_audio_input2,
|
479 |
-
ref_text_input2,
|
480 |
-
podcast_model_choice,
|
481 |
-
podcast_remove_silence,
|
482 |
-
],
|
483 |
-
outputs=podcast_output,
|
484 |
-
)
|
485 |
|
486 |
def parse_emotional_text(gen_text):
|
487 |
# Pattern to find (Emotion)
|
@@ -628,7 +587,7 @@ with gr.Blocks() as app_emotional:
|
|
628 |
|
629 |
# Model choice
|
630 |
model_choice_emotional = gr.Radio(
|
631 |
-
choices=["
|
632 |
)
|
633 |
|
634 |
with gr.Accordion("Advanced Settings", open=False):
|
@@ -772,7 +731,7 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip
|
|
772 |
</a>
|
773 |
"""
|
774 |
)
|
775 |
-
gr.TabbedInterface([app_tts,
|
776 |
|
777 |
@click.command()
|
778 |
@click.option("--port", "-p", default=None, type=int, help="Port to run the app on")
|
|
|
441 |
outputs=[audio_output, spectrogram_output],
|
442 |
)
|
443 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
|
445 |
def parse_emotional_text(gen_text):
|
446 |
# Pattern to find (Emotion)
|
|
|
587 |
|
588 |
# Model choice
|
589 |
model_choice_emotional = gr.Radio(
|
590 |
+
choices=["English","Polish"], label="Choose TTS Model", value="English"
|
591 |
)
|
592 |
|
593 |
with gr.Accordion("Advanced Settings", open=False):
|
|
|
731 |
</a>
|
732 |
"""
|
733 |
)
|
734 |
+
gr.TabbedInterface([app_tts, app_emotional, app_credits], ["TTS", "Multi-Style", "Credits"])
|
735 |
|
736 |
@click.command()
|
737 |
@click.option("--port", "-p", default=None, type=int, help="Port to run the app on")
|