text_to_audio / app.py
abderrahimbrighal's picture
Create app.py
758b718 verified
raw
history blame contribute delete
353 Bytes
from transformers import pipeline
# Example using a model hosted on the Hugging Face Hub
narrator = pipeline("text-to-speech", model="kakao-enterprise/vits-ljs")
text = "Your input text here."
narrated_text = narrator(text)
from IPython.display import Audio as IPythonAudio
IPythonAudio(narrated_text["audio"][0], rate=narrated_text["sampling_rate"])