AttributeError

#1
by murthy1998 - opened

When i am trying to generate the voice it is giving error.


AttributeError Traceback (most recent call last)
Cell In[13], line 1
----> 1 scipy.io.wavfile.write("techno.wav", rate=model.config.sampling_rate, data=output)

File f:\Text to Speech.venv\lib\site-packages\scipy\io\wavfile.py:772, in write(filename, rate, data)
769 fs = rate
771 try:
--> 772 dkind = data.dtype.kind
773 if not (dkind == 'i' or dkind == 'f' or (dkind == 'u' and
774 data.dtype.itemsize == 1)):
775 raise ValueError("Unsupported data type '%s'" % data.dtype)

AttributeError: 'torch.dtype' object has no attribute 'kind'

Hey @murthy1998 - thanks for reporting this. We can bypass the error by converting the output waveform from a torch tensor to a numpy array:

scipy.io.wavfile.write("techno.wav", rate=model.config.sampling_rate, data=output.numpy())

Hope that helps! I've fixed the main README as well: https://huggingface.co/facebook/mms-tts-tam/discussions/2

Sign up or log in to comment