Parler-TTS는 경량 텍스트 음성 변환(TTS) 모델로, 고품질의 자연스러운 음성을 생성하며, 화자의 스타일(성별, 음조, 말투 등)을 제어할 수 있습니다. 이 프로젝트는 Stability AI와 에든버러 대학교의 연구 논문 "Natural language guidance of high-fidelity text-to-speech with synthetic annotations"의 오픈 소스 구현입니다.
pip install git+https://github.com/huggingface/parler-tts.git
pip3 install --pre torch torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
import torch
from parler_tts import ParlerTTSForConditionalGeneration
from transformers import AutoTokenizer
import soundfile as sf
device = "cuda:0" if torch.cuda.is_available() else "cpu"
model = ParlerTTSForConditionalGeneration.from_pretrained("parler-tts/parler-tts-mini-v1").to(device)
tokenizer = AutoTokenizer.from_pretrained("parler-tts/parler-tts-mini-v1")
prompt = "Hey, how are you doing today?"
description = "A female speaker delivers a slightly expressive and animated speech with a moderate speed and pitch. The recording is of very high quality, with the speaker's voice sounding clear and very close up."
input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
audio_arr = generation.cpu().numpy().squeeze()
sf.write("parler_tts_out.wav", audio_arr, model.config.sampling_rate)
이 모델은 Laura, Gary, Jon, Lea, Karen, Rick, Brenda, David, Eileen, Jordan, Mike, Yann, Joy, James, Eric, Lauren, Rose, Will, Jason, Aaron, Naomie, Alisa, Patrick, Jerry, Tina, Jenna, Bill, Tom, Carol, Barbara, Rebecca, Anna, Bruce, Emily를 포함한 34명의 사전 정의된 화자를 지원합니다.
prompt = "Hey, how are you doing today?"
description = "Jon's voice is monotone yet slightly fast in delivery, with a very close recording that almost has no background noise."
input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
audio_arr = generation.cpu().numpy().squeeze()
sf.write("parler_tts_out.wav", audio_arr, model.config.sampling_rate)
accelerate launch ./training/run_parler_tts_training.py ./helpers/training_configs/starting_point_v1.json
프로젝트는 다음을 포함한 완전한 훈련 및 미세 조정 가이드를 제공합니다.
프로젝트에는 다양한 성능 최적화가 포함되어 있습니다.
프로젝트는 관대한 오픈 소스 라이선스를 채택하여 커뮤니티 기여 및 상업적 사용을 장려합니다. 이 프로젝트를 사용하는 경우 다음을 인용하는 것이 좋습니다.
@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}}
}
프로젝트는 특히 다음 분야에서 커뮤니티 기여를 환영합니다.
Parler TTS는 오픈 소스 TTS 기술의 중요한 진전을 나타내며, 연구자와 개발자에게 강력하고 유연한 텍스트 음성 변환 솔루션을 제공합니다.