You can then use the model with the following inference snippet:
py
1import torch
2from parler_tts import ParlerTTSForConditionalGeneration
3from transformers import AutoTokenizer
4import soundfile as sf
56device ="cuda:0"if torch.cuda.is_available()else"cpu"78model = ParlerTTSForConditionalGeneration.from_pretrained("parler-tts/parler-mini-v1-jenny").to(device)9tokenizer = AutoTokenizer.from_pretrained("parler-tts/parler-mini-v1-jenny")1011prompt ="Hey, how are you doing today? My name is Jenny, and I'm here to help you with any questions you have."12description ="Jenny speaks at an average pace with an animated delivery in a very confined sounding environment with clear audio quality."1314input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)15prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)1617generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)18audio_arr = generation.cpu().numpy().squeeze()19sf.write("parler_tts_out.wav", audio_arr, model.config.sampling_rate)
Citation
If you found this repository useful, please consider citing this work and also the original Stability AI paper:
@misc{lacombe-etal-2024-parler-tts,
author = {Yoach Lacombe and Vaibhav Srivastav and Sanchit Gandhi},
title = {Parler-TTS},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/huggingface/parler-tts}}
}
@misc{lyth2024natural,
title={Natural language guidance of high-fidelity text-to-speech with synthetic annotations},
author={Dan Lyth and Simon King},
year={2024},
eprint={2402.01912},
archivePrefix={arXiv},
primaryClass={cs.SD}
}
License
License - Attribution is required in software/websites/projects/interfaces (including voice interfaces) that generate audio in response to user action using this dataset. Atribution means: the voice must be referred to as "Jenny", and where at all practical, "Jenny (Dioco)". Attribution is not required when distributing the generated clips (although welcome). Commercial use is permitted. Don't do unfair things like claim the dataset is your own. No further restrictions apply.