From 05e06de0e7e5407147e31f5a454c81c924587149 Mon Sep 17 00:00:00 2001 From: James Betker Date: Wed, 27 Apr 2022 09:15:55 -0600 Subject: [PATCH] Revert "Merge pull request #3 from osanseviero/main" This reverts commit 1a41f7f7694cc88b10961424d10e4490a358f9fd, reversing changes made to cf7a4bc7e773465a8e913228d642b81ca0475eb7. --- tortoise_tts/api.py => api.py | 20 +++++++++--------- {tortoise_tts/data => data}/riding_hood.txt | 0 {tortoise_tts/data => data}/tokenizer.json | 0 tortoise_tts/do_tts.py => do_tts.py | 0 .../eval_multiple.py => eval_multiple.py | 0 ...om_tortoise.py => is_this_from_tortoise.py | 0 {tortoise_tts/models => models}/arch_util.py | 2 +- .../models => models}/autoregressive.py | 4 ++-- {tortoise_tts/models => models}/classifier.py | 2 +- {tortoise_tts/models => models}/clvp.py | 6 +++--- {tortoise_tts/models => models}/cvvp.py | 4 ++-- .../models => models}/diffusion_decoder.py | 2 +- .../models => models}/transformer.py | 0 {tortoise_tts/models => models}/vocoder.py | 0 .../models => models}/xtransformers.py | 0 tortoise_tts/read.py => read.py | 0 requirements.txt | 4 +--- .../results => results}/.gitattributes | 0 .../results => results}/various/desktop.ini | 0 ...mples_generator.py => samples_generator.py | 0 setup.py | 21 ------------------- tortoise_tts/sweep.py => sweep.py | 0 tortoise_tts/__init__.py | 1 - tortoise_tts/models/__init__.py | 0 tortoise_tts/results/__init__.py | 0 tortoise_tts/utils/__init__.py | 4 ---- tortoise_tts/voices/__init__.py | 0 {tortoise_tts/data => utils}/__init__.py | 0 {tortoise_tts/utils => utils}/audio.py | 2 +- {tortoise_tts/utils => utils}/diffusion.py | 0 {tortoise_tts/utils => utils}/stft.py | 0 {tortoise_tts/utils => utils}/tokenizer.py | 3 --- .../utils => utils}/typical_sampling.py | 0 33 files changed, 22 insertions(+), 53 deletions(-) rename tortoise_tts/api.py => api.py (96%) rename {tortoise_tts/data => data}/riding_hood.txt (100%) rename {tortoise_tts/data => data}/tokenizer.json (100%) rename tortoise_tts/do_tts.py => do_tts.py (100%) rename tortoise_tts/eval_multiple.py => eval_multiple.py (100%) rename tortoise_tts/is_this_from_tortoise.py => is_this_from_tortoise.py (100%) rename {tortoise_tts/models => models}/arch_util.py (99%) rename {tortoise_tts/models => models}/autoregressive.py (99%) rename {tortoise_tts/models => models}/classifier.py (97%) rename {tortoise_tts/models => models}/clvp.py (96%) rename {tortoise_tts/models => models}/cvvp.py (97%) rename {tortoise_tts/models => models}/diffusion_decoder.py (99%) rename {tortoise_tts/models => models}/transformer.py (100%) rename {tortoise_tts/models => models}/vocoder.py (100%) rename {tortoise_tts/models => models}/xtransformers.py (100%) rename tortoise_tts/read.py => read.py (100%) rename {tortoise_tts/results => results}/.gitattributes (100%) rename {tortoise_tts/results => results}/various/desktop.ini (100%) rename tortoise_tts/samples_generator.py => samples_generator.py (100%) delete mode 100644 setup.py rename tortoise_tts/sweep.py => sweep.py (100%) delete mode 100644 tortoise_tts/__init__.py delete mode 100644 tortoise_tts/models/__init__.py delete mode 100644 tortoise_tts/results/__init__.py delete mode 100644 tortoise_tts/utils/__init__.py delete mode 100644 tortoise_tts/voices/__init__.py rename {tortoise_tts/data => utils}/__init__.py (100%) rename {tortoise_tts/utils => utils}/audio.py (99%) rename {tortoise_tts/utils => utils}/diffusion.py (100%) rename {tortoise_tts/utils => utils}/stft.py (100%) rename {tortoise_tts/utils => utils}/tokenizer.py (97%) rename {tortoise_tts/utils => utils}/typical_sampling.py (100%) diff --git a/tortoise_tts/api.py b/api.py similarity index 96% rename from tortoise_tts/api.py rename to api.py index aa1f358..6aa94cf 100644 --- a/tortoise_tts/api.py +++ b/api.py @@ -8,18 +8,18 @@ import torch.nn.functional as F import progressbar import torchaudio -from tortoise_tts.models.classifier import AudioMiniEncoderWithClassifierHead -from tortoise_tts.models.cvvp import CVVP -from tortoise_tts.models.diffusion_decoder import DiffusionTts -from tortoise_tts.models.autoregressive import UnifiedVoice +from models.classifier import AudioMiniEncoderWithClassifierHead +from models.cvvp import CVVP +from models.diffusion_decoder import DiffusionTts +from models.autoregressive import UnifiedVoice from tqdm import tqdm -from tortoise_tts.models.arch_util import TorchMelSpectrogram -from tortoise_tts.models.clvp import CLVP -from tortoise_tts.models.vocoder import UnivNetGenerator -from tortoise_tts.utils.audio import load_audio, wav_to_univnet_mel, denormalize_tacotron_mel -from tortoise_tts.utils.diffusion import SpacedDiffusion, space_timesteps, get_named_beta_schedule -from tortoise_tts.utils.tokenizer import VoiceBpeTokenizer, lev_distance +from models.arch_util import TorchMelSpectrogram +from models.clvp import CLVP +from models.vocoder import UnivNetGenerator +from utils.audio import load_audio, wav_to_univnet_mel, denormalize_tacotron_mel +from utils.diffusion import SpacedDiffusion, space_timesteps, get_named_beta_schedule +from utils.tokenizer import VoiceBpeTokenizer, lev_distance pbar = None diff --git a/tortoise_tts/data/riding_hood.txt b/data/riding_hood.txt similarity index 100% rename from tortoise_tts/data/riding_hood.txt rename to data/riding_hood.txt diff --git a/tortoise_tts/data/tokenizer.json b/data/tokenizer.json similarity index 100% rename from tortoise_tts/data/tokenizer.json rename to data/tokenizer.json diff --git a/tortoise_tts/do_tts.py b/do_tts.py similarity index 100% rename from tortoise_tts/do_tts.py rename to do_tts.py diff --git a/tortoise_tts/eval_multiple.py b/eval_multiple.py similarity index 100% rename from tortoise_tts/eval_multiple.py rename to eval_multiple.py diff --git a/tortoise_tts/is_this_from_tortoise.py b/is_this_from_tortoise.py similarity index 100% rename from tortoise_tts/is_this_from_tortoise.py rename to is_this_from_tortoise.py diff --git a/tortoise_tts/models/arch_util.py b/models/arch_util.py similarity index 99% rename from tortoise_tts/models/arch_util.py rename to models/arch_util.py index 3390153..832315c 100644 --- a/tortoise_tts/models/arch_util.py +++ b/models/arch_util.py @@ -5,7 +5,7 @@ import torch import torch.nn as nn import torch.nn.functional as F import torchaudio -from tortoise_tts.models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias +from models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias def zero_module(module): diff --git a/tortoise_tts/models/autoregressive.py b/models/autoregressive.py similarity index 99% rename from tortoise_tts/models/autoregressive.py rename to models/autoregressive.py index aa2393a..6a91748 100644 --- a/tortoise_tts/models/autoregressive.py +++ b/models/autoregressive.py @@ -6,8 +6,8 @@ import torch.nn.functional as F from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions from transformers.utils.model_parallel_utils import get_device_map, assert_device_map -from tortoise_tts.models.arch_util import AttentionBlock -from tortoise_tts.utils.typical_sampling import TypicalLogitsWarper +from models.arch_util import AttentionBlock +from utils.typical_sampling import TypicalLogitsWarper def null_position_embeddings(range, dim): diff --git a/tortoise_tts/models/classifier.py b/models/classifier.py similarity index 97% rename from tortoise_tts/models/classifier.py rename to models/classifier.py index abd0ec8..c899773 100644 --- a/tortoise_tts/models/classifier.py +++ b/models/classifier.py @@ -3,7 +3,7 @@ import torch.nn as nn import torch.nn.functional as F from torch.utils.checkpoint import checkpoint -from tortoise_tts.models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock +from models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock class ResBlock(nn.Module): diff --git a/tortoise_tts/models/clvp.py b/models/clvp.py similarity index 96% rename from tortoise_tts/models/clvp.py rename to models/clvp.py index c054cc6..1eec06a 100644 --- a/tortoise_tts/models/clvp.py +++ b/models/clvp.py @@ -3,9 +3,9 @@ import torch.nn as nn import torch.nn.functional as F from torch import einsum -from tortoise_tts.models.arch_util import CheckpointedXTransformerEncoder -from tortoise_tts.models.transformer import Transformer -from tortoise_tts.models.xtransformers import Encoder +from models.arch_util import CheckpointedXTransformerEncoder +from models.transformer import Transformer +from models.xtransformers import Encoder def exists(val): diff --git a/tortoise_tts/models/cvvp.py b/models/cvvp.py similarity index 97% rename from tortoise_tts/models/cvvp.py rename to models/cvvp.py index fe441f9..0c9fd35 100644 --- a/tortoise_tts/models/cvvp.py +++ b/models/cvvp.py @@ -4,8 +4,8 @@ import torch.nn.functional as F from torch import einsum from torch.utils.checkpoint import checkpoint -from tortoise_tts.models.arch_util import AttentionBlock -from tortoise_tts.models.xtransformers import ContinuousTransformerWrapper, Encoder +from models.arch_util import AttentionBlock +from models.xtransformers import ContinuousTransformerWrapper, Encoder def exists(val): diff --git a/tortoise_tts/models/diffusion_decoder.py b/models/diffusion_decoder.py similarity index 99% rename from tortoise_tts/models/diffusion_decoder.py rename to models/diffusion_decoder.py index d72315f..5fdf7ad 100644 --- a/tortoise_tts/models/diffusion_decoder.py +++ b/models/diffusion_decoder.py @@ -7,7 +7,7 @@ import torch.nn as nn import torch.nn.functional as F from torch import autocast -from tortoise_tts.models.arch_util import normalization, AttentionBlock +from models.arch_util import normalization, AttentionBlock def is_latent(t): diff --git a/tortoise_tts/models/transformer.py b/models/transformer.py similarity index 100% rename from tortoise_tts/models/transformer.py rename to models/transformer.py diff --git a/tortoise_tts/models/vocoder.py b/models/vocoder.py similarity index 100% rename from tortoise_tts/models/vocoder.py rename to models/vocoder.py diff --git a/tortoise_tts/models/xtransformers.py b/models/xtransformers.py similarity index 100% rename from tortoise_tts/models/xtransformers.py rename to models/xtransformers.py diff --git a/tortoise_tts/read.py b/read.py similarity index 100% rename from tortoise_tts/read.py rename to read.py diff --git a/requirements.txt b/requirements.txt index 91503ea..b971e61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,4 @@ inflect progressbar einops unidecode -entmax -scipy -librosa \ No newline at end of file +entmax \ No newline at end of file diff --git a/tortoise_tts/results/.gitattributes b/results/.gitattributes similarity index 100% rename from tortoise_tts/results/.gitattributes rename to results/.gitattributes diff --git a/tortoise_tts/results/various/desktop.ini b/results/various/desktop.ini similarity index 100% rename from tortoise_tts/results/various/desktop.ini rename to results/various/desktop.ini diff --git a/tortoise_tts/samples_generator.py b/samples_generator.py similarity index 100% rename from tortoise_tts/samples_generator.py rename to samples_generator.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 0a9011f..0000000 --- a/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -from setuptools import setup, find_packages - -install_requires = [ - "torch", - "torchaudio", - "rotary_embedding_torch", - "transformers", - "tokenizers", - "inflect", - "progressbar", - "einops", - "unidecode", - "scipy", - "librosa" -] - -setup( - name="tortoise_tts", - packages=find_packages(), - install_requires=install_requires, -) diff --git a/tortoise_tts/sweep.py b/sweep.py similarity index 100% rename from tortoise_tts/sweep.py rename to sweep.py diff --git a/tortoise_tts/__init__.py b/tortoise_tts/__init__.py deleted file mode 100644 index c9cc7ce..0000000 --- a/tortoise_tts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .api import TextToSpeech diff --git a/tortoise_tts/models/__init__.py b/tortoise_tts/models/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tortoise_tts/results/__init__.py b/tortoise_tts/results/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tortoise_tts/utils/__init__.py b/tortoise_tts/utils/__init__.py deleted file mode 100644 index fa1f97f..0000000 --- a/tortoise_tts/utils/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .audio import ( - load_audio, - get_voices -) diff --git a/tortoise_tts/voices/__init__.py b/tortoise_tts/voices/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tortoise_tts/data/__init__.py b/utils/__init__.py similarity index 100% rename from tortoise_tts/data/__init__.py rename to utils/__init__.py diff --git a/tortoise_tts/utils/audio.py b/utils/audio.py similarity index 99% rename from tortoise_tts/utils/audio.py rename to utils/audio.py index e560c45..aad3a0f 100644 --- a/tortoise_tts/utils/audio.py +++ b/utils/audio.py @@ -6,7 +6,7 @@ import torchaudio import numpy as np from scipy.io.wavfile import read -from tortoise_tts.utils.stft import STFT +from utils.stft import STFT def load_wav_to_torch(full_path): diff --git a/tortoise_tts/utils/diffusion.py b/utils/diffusion.py similarity index 100% rename from tortoise_tts/utils/diffusion.py rename to utils/diffusion.py diff --git a/tortoise_tts/utils/stft.py b/utils/stft.py similarity index 100% rename from tortoise_tts/utils/stft.py rename to utils/stft.py diff --git a/tortoise_tts/utils/tokenizer.py b/utils/tokenizer.py similarity index 97% rename from tortoise_tts/utils/tokenizer.py rename to utils/tokenizer.py index f018abd..ed7e4cd 100644 --- a/tortoise_tts/utils/tokenizer.py +++ b/utils/tokenizer.py @@ -3,7 +3,6 @@ import re import inflect import torch from tokenizers import Tokenizer -from pathlib import Path # Regular expression matching whitespace: @@ -166,8 +165,6 @@ def lev_distance(s1, s2): class VoiceBpeTokenizer: def __init__(self, vocab_file='data/tokenizer.json'): - vocab_file = str(Path(__file__).parent.parent / Path(vocab_file)) - print(vocab_file) if vocab_file is not None: self.tokenizer = Tokenizer.from_file(vocab_file) diff --git a/tortoise_tts/utils/typical_sampling.py b/utils/typical_sampling.py similarity index 100% rename from tortoise_tts/utils/typical_sampling.py rename to utils/typical_sampling.py