hariom / app.py
Nikhil0987's picture
Update app.py
33a41f1 verified
raw
history blame contribute delete
285 Bytes
from transformers import pipeline
# Load the TTS model from Hugging Face
tts_model_id = "'gpt2'"
tts_pipeline = pipeline("text-to-speech", model=tts_model_id)
# Generate speech
result = tts_pipeline("This is the text I want to convert to speech.")
audio_array = result[0]['audio']