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 技術の重要な進歩を表しており、研究者と開発者に強力で柔軟なテキスト読み上げソリューションを提供します。