Instructions to use facebook/mms-tts-fra with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/mms-tts-fra with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="facebook/mms-tts-fra")# Load model directly from transformers import AutoTokenizer, AutoModelForTextToWaveform tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-fra") model = AutoModelForTextToWaveform.from_pretrained("facebook/mms-tts-fra") - Notebooks
- Google Colab
- Kaggle
Problem and solution to .wav saving - object has no attribute 'kind'
#1
by the-french-artist - opened
This line:
scipy.io.wavfile.write("techno.wav", rate=model.config.sampling_rate, data=output)
Causes this error:
AttributeError: 'torch.dtype' object has no attribute 'kind'
Solution:
After:
output = output.cpu()
Add this :
import scipy.io.wavfile
import numpy as np
data_np = output.numpy()
data_np_squeezed = np.squeeze(data_np)
scipy.io.wavfile.write("output.wav", rate=model.config.sampling_rate, data=data_np_squeezed)
Thanks!