-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Hello,
I'm trying to figure out what I need to do so to my numpy array can be vocoded by the UniversalVocoder.
Attached is a sample npy file.
The output is from a modified https://github.com/Tomiinek/Multilingual_Text_to_Speech
import os
import numpy
def main():
import torch
import soundfile as sf
from univoc import Vocoder
cwd: str = os.getcwd()
# download pretrained weights (and optionally move to GPU)
vocoder: Vocoder = Vocoder.from_pretrained(
"https://github.com/bshall/UniversalVocoding/releases/download/v0.2/univoc-ljspeech-7mtpaq.pt").cuda()
# load log-Mel spectrogram from file or from tts (see https://github.com/bshall/Tacotron for example)
mel = numpy.load(os.path.join(cwd, "tmp.npy"))
# generate waveform
with torch.no_grad():
wav, sr = vocoder.generate(mel)
# save output
sf.write(os.path.join(cwd, "tmp.wav"), wav, sr)
if __name__ == "__main__":
main()
Traceback (most recent call last):
File "/home/muksihs/git/Cherokee-TTS/tts-wrapper/uv.py", line 29, in <module>
main()
File "/home/muksihs/git/Cherokee-TTS/tts-wrapper/uv.py", line 22, in main
wav, sr = vocoder.generate(mel)
File "/home/muksihs/miniconda3/envs/UniversalVocoding/lib/python3.9/site-packages/univoc/model.py", line 102, in generate
mel, _ = self.rnn1(mel)
File "/home/muksihs/miniconda3/envs/UniversalVocoding/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/muksihs/miniconda3/envs/UniversalVocoding/lib/python3.9/site-packages/torch/nn/modules/rnn.py", line 821, in forward
max_batch_size = input.size(0) if self.batch_first else input.size(1)
TypeError: 'int' object is not callable
Metadata
Metadata
Assignees
Labels
No labels