File size: 353 Bytes
758b718
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
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"])