Update app.py
Browse files
app.py
CHANGED
@@ -25,13 +25,6 @@ def init_TTS(config):
|
|
25 |
tts = TTS(config['inference']['model']).to(device)
|
26 |
return tts
|
27 |
|
28 |
-
dataset_choice = gr.Radio(label="Choose Dataset",
|
29 |
-
choices=["Hugging Face Hub Dataset", "Upload Your Own"],
|
30 |
-
value="Hugging Face Hub Dataset")
|
31 |
-
dataset_predefined = gr.Textbox(label="Hugging Face Hub Training Dataset",
|
32 |
-
value='yahma/alpaca-cleaned',
|
33 |
-
visible=True)
|
34 |
-
|
35 |
|
36 |
@spaces.GPU
|
37 |
def generate_speech(voice_choice, microphone, text):
|
@@ -56,18 +49,21 @@ def generate_speech(voice_choice, microphone, text):
|
|
56 |
###################################### main ######################################
|
57 |
def main(config):
|
58 |
|
59 |
-
|
|
|
|
|
60 |
choices=["Record", "Predefined (Nancy)"],
|
61 |
value="Record")
|
|
|
|
|
62 |
|
63 |
# Create the Gradio interface
|
64 |
demo = gr.Interface(
|
65 |
fn=generate_speech,
|
66 |
inputs=[
|
67 |
voice_choice,
|
68 |
-
|
69 |
-
|
70 |
-
gr.Textbox(label="Enter your text")
|
71 |
],
|
72 |
outputs="audio",
|
73 |
title="Voice cloning and Synthesis with Coqui-XTTS",
|
|
|
25 |
tts = TTS(config['inference']['model']).to(device)
|
26 |
return tts
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
@spaces.GPU
|
30 |
def generate_speech(voice_choice, microphone, text):
|
|
|
49 |
###################################### main ######################################
|
50 |
def main(config):
|
51 |
|
52 |
+
# gradio elements
|
53 |
+
|
54 |
+
voice_choice = gr.Radio(label="Record or skip to use predefined voice.",
|
55 |
choices=["Record", "Predefined (Nancy)"],
|
56 |
value="Record")
|
57 |
+
microphone = gr.Audio(label="Audio", sources="microphone", type="filepath", elem_id='audio')
|
58 |
+
enter_text = gr.Textbox(label="Enter your text")
|
59 |
|
60 |
# Create the Gradio interface
|
61 |
demo = gr.Interface(
|
62 |
fn=generate_speech,
|
63 |
inputs=[
|
64 |
voice_choice,
|
65 |
+
microphone,
|
66 |
+
enter_text
|
|
|
67 |
],
|
68 |
outputs="audio",
|
69 |
title="Voice cloning and Synthesis with Coqui-XTTS",
|