mirror of https://github.com/coqui-ai/TTS.git
linter fixes and version updates for deps
This commit is contained in:
parent
8774e37444
commit
5c46543765
|
@ -344,7 +344,7 @@ def main(args): # pylint: disable=redefined-outer-name
|
||||||
|
|
||||||
# setup criterion
|
# setup criterion
|
||||||
criterion = torch.nn.L1Loss().cuda()
|
criterion = torch.nn.L1Loss().cuda()
|
||||||
|
|
||||||
if use_cuda:
|
if use_cuda:
|
||||||
model.cuda()
|
model.cuda()
|
||||||
criterion.cuda()
|
criterion.cuda()
|
||||||
|
|
|
@ -292,7 +292,7 @@ class AudioProcessor(object):
|
||||||
return pad // 2, pad // 2 + pad % 2
|
return pad // 2, pad // 2 + pad % 2
|
||||||
|
|
||||||
### Compute F0 ###
|
### Compute F0 ###
|
||||||
# TODO: pw causes some dep issues
|
# TODO: pw causes some dep issues
|
||||||
# def compute_f0(self, x):
|
# def compute_f0(self, x):
|
||||||
# f0, t = pw.dio(
|
# f0, t = pw.dio(
|
||||||
# x.astype(np.double),
|
# x.astype(np.double),
|
||||||
|
|
15
hubconf.py
15
hubconf.py
|
@ -1,9 +1,6 @@
|
||||||
dependencies = ['torch', 'gdown']
|
dependencies = ['torch', 'gdown']
|
||||||
import torch
|
import torch
|
||||||
import os
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
from TTS.utils.generic_utils import get_user_data_dir
|
|
||||||
from TTS.utils.synthesizer import Synthesizer
|
from TTS.utils.synthesizer import Synthesizer
|
||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
|
|
||||||
|
@ -15,7 +12,7 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name='vocoder
|
||||||
>>> synthesizer = torch.hub.load('mozilla/TTS', 'tts', source='github')
|
>>> synthesizer = torch.hub.load('mozilla/TTS', 'tts', source='github')
|
||||||
>>> wavs = synthesizer.tts("This is a test! This is also a test!!")
|
>>> wavs = synthesizer.tts("This is a test! This is also a test!!")
|
||||||
wavs - is a list of values of the synthesized speech.
|
wavs - is a list of values of the synthesized speech.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
model_name (str, optional): One of the model names from .model.json. Defaults to 'tts_models/en/ljspeech/tacotron2-DCA'.
|
model_name (str, optional): One of the model names from .model.json. Defaults to 'tts_models/en/ljspeech/tacotron2-DCA'.
|
||||||
vocoder_name (str, optional): One of the model names from .model.json. Defaults to 'vocoder_models/en/ljspeech/mulitband-melgan'.
|
vocoder_name (str, optional): One of the model names from .model.json. Defaults to 'vocoder_models/en/ljspeech/mulitband-melgan'.
|
||||||
|
@ -23,15 +20,15 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA', vocoder_name='vocoder
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
TTS.utils.synthesizer.Synthesizer: Synthesizer object wrapping both vocoder and tts models.
|
TTS.utils.synthesizer.Synthesizer: Synthesizer object wrapping both vocoder and tts models.
|
||||||
"""
|
"""
|
||||||
manager = ModelManager()
|
manager = ModelManager()
|
||||||
|
|
||||||
model_path, config_path = manager.download_model(model_name)
|
model_path, config_path = manager.download_model(model_name)
|
||||||
vocoder_path, vocoder_config_path = manager.download_model(vocoder_name)
|
vocoder_path, vocoder_config_path = manager.download_model(vocoder_name)
|
||||||
|
|
||||||
# create synthesizer
|
# create synthesizer
|
||||||
synthesizer = Synthesizer(model_path, config_path, vocoder_path, vocoder_config_path)
|
synt = Synthesizer(model_path, config_path, vocoder_path, vocoder_config_path)
|
||||||
return synthesizer
|
return synt
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools", "wheel", "Cython", "numpy>=1.16.0"]
|
requires = ["setuptools", "wheel", "Cython", "numpy==1.17.0"]
|
|
@ -1,6 +1,6 @@
|
||||||
torch>=1.5
|
torch>=1.5
|
||||||
tensorflow==2.3.1
|
tensorflow==2.3.1
|
||||||
numpy>=1.16.0
|
numpy==1.17.0
|
||||||
scipy>=0.19.0
|
scipy>=0.19.0
|
||||||
numba==0.48
|
numba==0.48
|
||||||
librosa==0.7.2
|
librosa==0.7.2
|
||||||
|
|
|
@ -61,7 +61,8 @@ def gan_dataset_case(batch_size, seq_len, hop_len, conv_pad, return_segments, us
|
||||||
mel = ap.melspectrogram(audio)
|
mel = ap.melspectrogram(audio)
|
||||||
# the first 2 and the last 2 frames are skipped due to the padding
|
# the first 2 and the last 2 frames are skipped due to the padding
|
||||||
# differences in stft
|
# differences in stft
|
||||||
assert (feat - mel[:, :feat1.shape[-1]])[:, 2:-2].sum() <= 0, f' [!] {(feat - mel[:, :feat1.shape[-1]])[:, 2:-2].sum()}'
|
max_diff = abs((feat - mel[:, :feat1.shape[-1]])[:, 2:-2]).max()
|
||||||
|
assert max_diff <= 0, f' [!] {max_diff}'
|
||||||
|
|
||||||
count_iter += 1
|
count_iter += 1
|
||||||
# if count_iter == max_iter:
|
# if count_iter == max_iter:
|
||||||
|
|
Loading…
Reference in New Issue