加载中…
加载中…
This model fine-tunes Microsoft’s SpeechT5 to reproduce Jerry Cuomo’s speaking voice.
It was trained entirely in Google Colab using open-source tools from 🤗 Transformers, SpeechBrain, and Librosa.
A PyTorch-only text-to-speech model that generates speech from text using a fine-tuned version of SpeechT5 and a HiFi-GAN vocoder.
The speaker embedding was extracted with SpeechBrain’s spkrec-xvect-voxceleb model.
microsoft/speecht5_tts microsoft/speecht5_hifigan transcriptions.csv Key hyperparameters
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
import torch, soundfile as sf
repo = "YOUR_USER/speecht5-jerry"
processor = SpeechT5Processor.from_pretrained(repo)
model = SpeechT5ForTextToSpeech.from_pretrained(repo)
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
text = "Hello, this is Jerry from the Wild Ducks podcast."
inputs = processor(text=text, return_tensors="pt")
# Example speaker embedding (load or extract from dataset)
import numpy as np
speaker = torch.tensor(np.load("speaker_emb.npy")).unsqueeze(0)
speech = model.generate_speech(
inputs["input_ids"], speaker_embeddings=speaker, vocoder=vocoder
)
sf.write("jerry_demo.wav", speech.numpy(), 16000)
microsoft/speecht5_tts