mirror of
https://github.com/wassname/TTS.git
synced 2026-09-11 12:00:24 +08:00
Remove Tensorflow requeriment (#1225)
* Remove TF modules * Remove TF unit tests * Remove TF vocoder modules * Remove TF convert scripts * Remove TF requirement * Remove the Docs TF instructions * Remove TF inference support
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
import tensorflow as tf
|
||||
import torch
|
||||
|
||||
from TTS.vocoder.tf.models.melgan_generator import MelganGenerator
|
||||
|
||||
use_cuda = torch.cuda.is_available()
|
||||
|
||||
|
||||
@unittest.skipIf(use_cuda, " [!] Skip Test: Loosy TF support.")
|
||||
def test_melgan_generator():
|
||||
hop_length = 256
|
||||
model = MelganGenerator()
|
||||
# pylint: disable=no-value-for-parameter
|
||||
dummy_input = tf.random.uniform((4, 80, 64))
|
||||
output = model(dummy_input, training=False)
|
||||
assert np.all(output.shape == (4, 1, 64 * hop_length)), output.shape
|
||||
@@ -1,31 +0,0 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import soundfile as sf
|
||||
import tensorflow as tf
|
||||
import torch
|
||||
from librosa.core import load
|
||||
|
||||
from tests import get_tests_input_path, get_tests_output_path, get_tests_path
|
||||
from TTS.vocoder.tf.layers.pqmf import PQMF
|
||||
|
||||
TESTS_PATH = get_tests_path()
|
||||
WAV_FILE = os.path.join(get_tests_input_path(), "example_1.wav")
|
||||
use_cuda = torch.cuda.is_available()
|
||||
|
||||
|
||||
@unittest.skipIf(use_cuda, " [!] Skip Test: Loosy TF support.")
|
||||
def test_pqmf():
|
||||
w, sr = load(WAV_FILE)
|
||||
|
||||
layer = PQMF(N=4, taps=62, cutoff=0.15, beta=9.0)
|
||||
w, sr = load(WAV_FILE)
|
||||
w2 = tf.convert_to_tensor(w[None, None, :])
|
||||
b2 = layer.analysis(w2)
|
||||
w2_ = layer.synthesis(b2)
|
||||
w2_ = w2.numpy()
|
||||
|
||||
print(w2_.max())
|
||||
print(w2_.min())
|
||||
print(w2_.mean())
|
||||
sf.write(os.path.join(get_tests_output_path(), "tf_pqmf_output.wav"), w2_.flatten(), sr)
|
||||
Reference in New Issue
Block a user