Downloads · 30 days
11
8% of all-time downloads
Amirhossein75/Emotion-Aware-TTS-Style-Transfer
Emotion-Aware-TTS-Style-Transfer is a text-to-speech model from Amirhossein75. Use it when you need text read aloud. It is set up for transformers. The card lists the license as other.
This repository provides an end‑to‑end recipe for emotion‑aware text‑to‑speech (TTS) with style transfer, built on top of Microsoft SpeechT5 for TTS, WavLM for prosody/emotion representation, and SpeechBrain ECAPA‑TDN…
Downloads · 30 days
11
8% of all-time downloads
All-time downloads
139
Public
Parameters
144M
7 GB on disk
Likes
1
Public
Click a slice to open those files.
.pt4.6 GB · 61%
From the Hugging Face model README
This repository provides an end‑to‑end recipe for emotion‑aware text‑to‑speech (TTS) with style transfer, built on top of Microsoft SpeechT5 for TTS, WavLM for prosody/emotion representation, and SpeechBrain ECAPA‑TDNN for speaker embeddings. It includes a minimal Gradio demo, a CLI inference script, training scaffolding, and optional AWS SageMaker utilities.
The project adapts a SpeechT5 TTS backbone and injects two conditioning signals during synthesis:
Emotion / prosody style: features extracted from a reference WAV using WavLM (base‑plus) are mean‑pooled and projected by a trainable StyleAdaptor module.
Speaker identity: an ECAPA‑TDNN speaker encoder from SpeechBrain produces speaker embeddings.
Fusion: a trainable StyleSpeakerFusion merges both vectors into the 512‑D speaker_embeddings tensor expected by SpeechT5 during generation. The official SpeechT5 HiFi‑GAN vocoder renders the waveform.
Developed by: Amirhossein Yousefiramandi (GitHub: amirhossein-yousefi)
Model type: TTS with emotion‑style transfer (recipe + training/inference code)
Language(s): Primarily English
License: Repository currently has no LICENSE file; treat code as “all rights reserved” unless the author adds a license. Base model licenses are listed in the License section below.
Finetuned from model: microsoft/speecht5_tts
microsoft/speecht5_ttsmicrosoft/speecht5_hifiganmicrosoft/wavlm-base-plusspeechbrain/spkrec-ecapa-voxcelebExample scenarios:
Prereqs: Python 3.10+, GPU w/ CUDA recommended.
Install:pip install -r requirements.txtfrom the repo root.
Run the local demo (Gradio):
git clone https://github.com/amirhossein-yousefi/Emotion-Aware-TTS-Style-Transfer.git
cd Emotion-Aware-TTS-Style-Transfer
pip install -r requirements.txt
# Launch the UI; it will prompt for your checkpoint directory (see Training)
python src/app.py
Discover CLI options for inference & training:
# Inference (style transfer)
python src/infer_emotts.py --help
# Training flags (see "Training Details" for typical values)
python src/train_emotts.py --help
Baseline TTS (no style transfer) with SpeechT5 in Transformers (for comparison):
from transformers import pipeline
import torch, soundfile as sf
from datasets import load_dataset
synth = pipeline("text-to-speech", "microsoft/speecht5_tts")
spk = torch.tensor(load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")[7306]["xvector"]).unsqueeze(0)
out = synth("Hello from SpeechT5!", forward_params={"speaker_embeddings": spk})
sf.write("speech.wav", out["audio"], samplerate=out["sampling_rate'])
Primary example dataset: RAVDESS (speech subset). It contains 24 professional actors (12F/12M) producing two fixed sentences across eight emotional categories; the PLOS ONE paper details construction and validation. License: CC BY‑NC‑SA 4.0 (non‑commercial); commercial licenses available from the maintainers.
The repo includes a helper to build a CSV manifest (columns: path, text, emotion, speaker, style_path) from extracted RAVDESS wavs.
The main entry point is src/train_emotts.py. Training jointly adapts SpeechT5 and learns two small modules:
speaker_embeddings expected by SpeechT5.data/raw.py parses RAVDESS filenames to map emotion labels and creates the training manifest.Reference values from the repo examples:
--base_tts microsoft/speecht5_tts; --vocoder microsoft/speecht5_hifigan--ssl_name microsoft/wavlm-base-plus; --spk_embedder speechbrain/spkrec-ecapa-voxceleb--max_steps 4000, --lr 1e-5, --warmup_steps 500--per_device_train_batch_size 4, --per_device_eval_batch_size 2, --gradient_accumulation_steps 8--fp16 (mixed precision)--emo_ce_weight 0.2epochs 5, batch_size 8, sample_rate 22050 (see sagemaker/config.example.yaml).2,391.8157 seconds; Total FLOPs: 3,285,475,498,393,600.The system demonstrates controllable emotion style transfer on top of a strong TTS backbone, with modular adapters and optional PEFT to simplify training.
Use the MLCO2 Impact calculator for your specific runs.
speaker_embeddings to SpeechT5.--emo_ce_weight).huggingface_hub (with optional bitsandbytes).microsoft/speecht5_tts — MIT.microsoft/speecht5_hifigan — MIT.speechbrain/spkrec-ecapa-voxceleb — Apache‑2.0 (SpeechBrain toolkit).microsoft/wavlm-base-plus — see the UniSpeech repository license (Microsoft).Core papers
BibTeX (selection)
@inproceedings{ao-etal-2022-speecht5,
title = {SpeechT5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing},
author = {Ao, Junyi and Wang, Rui and Zhou, Long and Wang, Chengyi and Ren, Shuo and Wu, Yu and Liu, Shujie and Ko, Tom and Li, Qing and Zhang, Yu and Wei, Zhihua and Qian, Yao and Li, Jinyu and Wei, Furu},
booktitle = {ACL},
year = {2022}
}
@article{chen2022wavlm,
title={WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing},
author={Chen, Sanyuan and Wang, Chengyi and Chen, Zhengyang and et al.},
journal={arXiv:2110.13900},
year={2022}
}
@inproceedings{Desplanques2020ECAPA,
title={{ECAPA-TDNN}: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification},
author={Desplanques, Brecht and Thienpondt, Jenthe and Demuynck, Kris},
booktitle={Interspeech},
year={2020}
}
@article{livingstone2018ravdess,
title={The Ryerson Audio-Visual Database of Emotional Speech and Song (RAVDESS)},
author={Livingstone, Steven R and Russo, Frank A},
journal={PLOS ONE},
year={2018},
volume={13},
number={5},
pages={e0196391}
}
@amirhossein-yousefi).