DSatishchandra commited on
Commit
85763a6
1 Parent(s): 46c3d84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
- import torch
4
 
5
  # Initialize Hugging Face pipelines
6
  speech_to_text = pipeline("automatic-speech-recognition", model="openai/whisper-large")
7
 
8
- # Use a valid TTS model for text-to-speech (VITS model from Hugging Face)
9
- text_to_speech = pipeline("text-to-speech", model="espnet/kan-bayashi_ljspeech_vits", device=0) # Use CPU or GPU (cuda)
10
 
11
  # Function to process speech to text and text to speech
12
  def process_audio(input_audio):
 
1
  import gradio as gr
2
  from transformers import pipeline
 
3
 
4
  # Initialize Hugging Face pipelines
5
  speech_to_text = pipeline("automatic-speech-recognition", model="openai/whisper-large")
6
 
7
+ # Use a compatible TTS model for text-to-speech (FastSpeech2)
8
+ text_to_speech = pipeline("text-to-speech", model="facebook/fastspeech2-en-ljspeech", device=0) # Use CPU or GPU (cuda)
9
 
10
  # Function to process speech to text and text to speech
11
  def process_audio(input_audio):