Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,8 @@ model = SpeechT5ForTextToSpeech.from_pretrained("krishna195/speecht5_krishna_fin
|
|
11 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
12 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
13 |
|
14 |
-
#
|
15 |
-
speaker_embeddings = torch.randn(1, 512) # Example speaker embedding size
|
16 |
|
17 |
# Function to generate speech from input text
|
18 |
def text_to_speech(input_text):
|
@@ -32,15 +32,12 @@ def text_to_speech(input_text):
|
|
32 |
# Create Gradio UI
|
33 |
iface = gr.Interface(
|
34 |
fn=text_to_speech,
|
35 |
-
inputs="
|
36 |
outputs="audio",
|
37 |
title="Text to Speech Generator",
|
38 |
-
description="Enter the text you want to convert to speech, and the model will generate the corresponding
|
39 |
-
|
40 |
-
|
41 |
-
["The CUDA programming model allows parallel computing on GPUs."],
|
42 |
-
["TensorFlow and PyTorch are popular machine learning frameworks."]
|
43 |
-
]
|
44 |
)
|
45 |
|
46 |
# Launch the Gradio interface
|
|
|
11 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
12 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
13 |
|
14 |
+
# Dummy speaker embeddings for speech generation (replace with actual embeddings if needed)
|
15 |
+
speaker_embeddings = torch.randn(1, 512) # Example speaker embedding size
|
16 |
|
17 |
# Function to generate speech from input text
|
18 |
def text_to_speech(input_text):
|
|
|
32 |
# Create Gradio UI
|
33 |
iface = gr.Interface(
|
34 |
fn=text_to_speech,
|
35 |
+
inputs=gr.Textbox(label="Enter Text"),
|
36 |
outputs="audio",
|
37 |
title="Text to Speech Generator",
|
38 |
+
description="Enter the text you want to convert to speech, and the model will generate the corresponding audio.",
|
39 |
+
layout="vertical", # Use vertical layout
|
40 |
+
theme="default" # Use default theme
|
|
|
|
|
|
|
41 |
)
|
42 |
|
43 |
# Launch the Gradio interface
|