krishna195 commited on
Commit
9cf9f2f
·
verified ·
1 Parent(s): d0af1dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
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
- # Speaker embeddings for speech generation (replace this with actual embeddings if needed)
15
- speaker_embeddings = torch.randn(1, 512) # Example speaker embedding size (dummy embeddings)
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="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 speech.",
39
- examples=[
40
- ["Hello, how are you doing today?"],
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