osanseviero commited on
Commit
3b19328
β€’
1 Parent(s): cf7a4bc

Package everything

Browse files
Files changed (33) hide show
  1. requirements.txt +3 -1
  2. setup.py +22 -0
  3. tortoise_tts/__init__.py +1 -0
  4. api.py β†’ tortoise_tts/api.py +10 -10
  5. {utils β†’ tortoise_tts/data}/__init__.py +0 -0
  6. {data β†’ tortoise_tts/data}/riding_hood.txt +0 -0
  7. {data β†’ tortoise_tts/data}/tokenizer.json +0 -0
  8. do_tts.py β†’ tortoise_tts/do_tts.py +0 -0
  9. eval_multiple.py β†’ tortoise_tts/eval_multiple.py +0 -0
  10. is_this_from_tortoise.py β†’ tortoise_tts/is_this_from_tortoise.py +0 -0
  11. tortoise_tts/models/__init__.py +0 -0
  12. {models β†’ tortoise_tts/models}/arch_util.py +1 -1
  13. {models β†’ tortoise_tts/models}/autoregressive.py +2 -2
  14. {models β†’ tortoise_tts/models}/classifier.py +1 -1
  15. {models β†’ tortoise_tts/models}/clvp.py +3 -3
  16. {models β†’ tortoise_tts/models}/cvvp.py +2 -2
  17. {models β†’ tortoise_tts/models}/diffusion_decoder.py +1 -1
  18. {models β†’ tortoise_tts/models}/transformer.py +0 -0
  19. {models β†’ tortoise_tts/models}/vocoder.py +0 -0
  20. {models β†’ tortoise_tts/models}/xtransformers.py +0 -0
  21. read.py β†’ tortoise_tts/read.py +0 -0
  22. {results β†’ tortoise_tts/results}/.gitattributes +0 -0
  23. tortoise_tts/results/__init__.py +0 -0
  24. {results β†’ tortoise_tts/results}/various/desktop.ini +0 -0
  25. samples_generator.py β†’ tortoise_tts/samples_generator.py +0 -0
  26. sweep.py β†’ tortoise_tts/sweep.py +0 -0
  27. tortoise_tts/utils/__init__.py +4 -0
  28. {utils β†’ tortoise_tts/utils}/audio.py +1 -1
  29. {utils β†’ tortoise_tts/utils}/diffusion.py +0 -0
  30. {utils β†’ tortoise_tts/utils}/stft.py +0 -0
  31. {utils β†’ tortoise_tts/utils}/tokenizer.py +3 -0
  32. {utils β†’ tortoise_tts/utils}/typical_sampling.py +0 -0
  33. tortoise_tts/voices/__init__.py +0 -0
requirements.txt CHANGED
@@ -7,4 +7,6 @@ inflect
7
  progressbar
8
  einops
9
  unidecode
10
- entmax
 
 
 
7
  progressbar
8
  einops
9
  unidecode
10
+ entmax
11
+ scipy
12
+ librosa
setup.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from setuptools import setup, find_packages
2
+
3
+ install_requires = [
4
+ "torch",
5
+ "torchaudio",
6
+ "rotary_embedding_torch",
7
+ "transformers",
8
+ "tokenizers",
9
+ "inflect",
10
+ "progressbar",
11
+ "einops",
12
+ "unidecode",
13
+ "entmax",
14
+ "scipy",
15
+ "librosa"
16
+ ]
17
+
18
+ setup(
19
+ name="tortoise_tts",
20
+ packages=['tortoise_tts'],
21
+ install_requires=install_requires,
22
+ )
tortoise_tts/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from .api import TextToSpeech
api.py β†’ tortoise_tts/api.py RENAMED
@@ -8,18 +8,18 @@ import torch.nn.functional as F
8
  import progressbar
9
  import torchaudio
10
 
11
- from models.classifier import AudioMiniEncoderWithClassifierHead
12
- from models.cvvp import CVVP
13
- from models.diffusion_decoder import DiffusionTts
14
- from models.autoregressive import UnifiedVoice
15
  from tqdm import tqdm
16
 
17
- from models.arch_util import TorchMelSpectrogram
18
- from models.clvp import CLVP
19
- from models.vocoder import UnivNetGenerator
20
- from utils.audio import load_audio, wav_to_univnet_mel, denormalize_tacotron_mel
21
- from utils.diffusion import SpacedDiffusion, space_timesteps, get_named_beta_schedule
22
- from utils.tokenizer import VoiceBpeTokenizer, lev_distance
23
 
24
 
25
  pbar = None
 
8
  import progressbar
9
  import torchaudio
10
 
11
+ from tortoise_tts.models.classifier import AudioMiniEncoderWithClassifierHead
12
+ from tortoise_tts.models.cvvp import CVVP
13
+ from tortoise_tts.models.diffusion_decoder import DiffusionTts
14
+ from tortoise_tts.models.autoregressive import UnifiedVoice
15
  from tqdm import tqdm
16
 
17
+ from tortoise_tts.models.arch_util import TorchMelSpectrogram
18
+ from tortoise_tts.models.clvp import CLVP
19
+ from tortoise_tts.models.vocoder import UnivNetGenerator
20
+ from tortoise_tts.utils.audio import load_audio, wav_to_univnet_mel, denormalize_tacotron_mel
21
+ from tortoise_tts.utils.diffusion import SpacedDiffusion, space_timesteps, get_named_beta_schedule
22
+ from tortoise_tts.utils.tokenizer import VoiceBpeTokenizer, lev_distance
23
 
24
 
25
  pbar = None
{utils β†’ tortoise_tts/data}/__init__.py RENAMED
File without changes
{data β†’ tortoise_tts/data}/riding_hood.txt RENAMED
File without changes
{data β†’ tortoise_tts/data}/tokenizer.json RENAMED
File without changes
do_tts.py β†’ tortoise_tts/do_tts.py RENAMED
File without changes
eval_multiple.py β†’ tortoise_tts/eval_multiple.py RENAMED
File without changes
is_this_from_tortoise.py β†’ tortoise_tts/is_this_from_tortoise.py RENAMED
File without changes
tortoise_tts/models/__init__.py ADDED
File without changes
{models β†’ tortoise_tts/models}/arch_util.py RENAMED
@@ -5,7 +5,7 @@ import torch
5
  import torch.nn as nn
6
  import torch.nn.functional as F
7
  import torchaudio
8
- from models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias
9
 
10
 
11
  def zero_module(module):
 
5
  import torch.nn as nn
6
  import torch.nn.functional as F
7
  import torchaudio
8
+ from tortoise_tts.models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias
9
 
10
 
11
  def zero_module(module):
{models β†’ tortoise_tts/models}/autoregressive.py RENAMED
@@ -6,8 +6,8 @@ import torch.nn.functional as F
6
  from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList
7
  from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions
8
  from transformers.utils.model_parallel_utils import get_device_map, assert_device_map
9
- from models.arch_util import AttentionBlock
10
- from utils.typical_sampling import TypicalLogitsWarper
11
 
12
 
13
  def null_position_embeddings(range, dim):
 
6
  from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList
7
  from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions
8
  from transformers.utils.model_parallel_utils import get_device_map, assert_device_map
9
+ from tortoise_tts.models.arch_util import AttentionBlock
10
+ from tortoise_tts.utils.typical_sampling import TypicalLogitsWarper
11
 
12
 
13
  def null_position_embeddings(range, dim):
{models β†’ tortoise_tts/models}/classifier.py RENAMED
@@ -3,7 +3,7 @@ import torch.nn as nn
3
  import torch.nn.functional as F
4
  from torch.utils.checkpoint import checkpoint
5
 
6
- from models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock
7
 
8
 
9
  class ResBlock(nn.Module):
 
3
  import torch.nn.functional as F
4
  from torch.utils.checkpoint import checkpoint
5
 
6
+ from tortoise_tts.models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock
7
 
8
 
9
  class ResBlock(nn.Module):
{models β†’ tortoise_tts/models}/clvp.py RENAMED
@@ -3,9 +3,9 @@ import torch.nn as nn
3
  import torch.nn.functional as F
4
  from torch import einsum
5
 
6
- from models.arch_util import CheckpointedXTransformerEncoder
7
- from models.transformer import Transformer
8
- from models.xtransformers import Encoder
9
 
10
 
11
  def exists(val):
 
3
  import torch.nn.functional as F
4
  from torch import einsum
5
 
6
+ from tortoise_tts.models.arch_util import CheckpointedXTransformerEncoder
7
+ from tortoise_tts.models.transformer import Transformer
8
+ from tortoise_tts.models.xtransformers import Encoder
9
 
10
 
11
  def exists(val):
{models β†’ tortoise_tts/models}/cvvp.py RENAMED
@@ -4,8 +4,8 @@ import torch.nn.functional as F
4
  from torch import einsum
5
  from torch.utils.checkpoint import checkpoint
6
 
7
- from models.arch_util import AttentionBlock
8
- from models.xtransformers import ContinuousTransformerWrapper, Encoder
9
 
10
 
11
  def exists(val):
 
4
  from torch import einsum
5
  from torch.utils.checkpoint import checkpoint
6
 
7
+ from tortoise_tts.models.arch_util import AttentionBlock
8
+ from tortoise_tts.models.xtransformers import ContinuousTransformerWrapper, Encoder
9
 
10
 
11
  def exists(val):
{models β†’ tortoise_tts/models}/diffusion_decoder.py RENAMED
@@ -7,7 +7,7 @@ import torch.nn as nn
7
  import torch.nn.functional as F
8
  from torch import autocast
9
 
10
- from models.arch_util import normalization, AttentionBlock
11
 
12
 
13
  def is_latent(t):
 
7
  import torch.nn.functional as F
8
  from torch import autocast
9
 
10
+ from tortoise_tts.models.arch_util import normalization, AttentionBlock
11
 
12
 
13
  def is_latent(t):
{models β†’ tortoise_tts/models}/transformer.py RENAMED
File without changes
{models β†’ tortoise_tts/models}/vocoder.py RENAMED
File without changes
{models β†’ tortoise_tts/models}/xtransformers.py RENAMED
File without changes
read.py β†’ tortoise_tts/read.py RENAMED
File without changes
{results β†’ tortoise_tts/results}/.gitattributes RENAMED
File without changes
tortoise_tts/results/__init__.py ADDED
File without changes
{results β†’ tortoise_tts/results}/various/desktop.ini RENAMED
File without changes
samples_generator.py β†’ tortoise_tts/samples_generator.py RENAMED
File without changes
sweep.py β†’ tortoise_tts/sweep.py RENAMED
File without changes
tortoise_tts/utils/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from .audio import (
2
+ load_audio,
3
+ get_voices
4
+ )
{utils β†’ tortoise_tts/utils}/audio.py RENAMED
@@ -6,7 +6,7 @@ import torchaudio
6
  import numpy as np
7
  from scipy.io.wavfile import read
8
 
9
- from utils.stft import STFT
10
 
11
 
12
  def load_wav_to_torch(full_path):
 
6
  import numpy as np
7
  from scipy.io.wavfile import read
8
 
9
+ from tortoise_tts.utils.stft import STFT
10
 
11
 
12
  def load_wav_to_torch(full_path):
{utils β†’ tortoise_tts/utils}/diffusion.py RENAMED
File without changes
{utils β†’ tortoise_tts/utils}/stft.py RENAMED
File without changes
{utils β†’ tortoise_tts/utils}/tokenizer.py RENAMED
@@ -3,6 +3,7 @@ import re
3
  import inflect
4
  import torch
5
  from tokenizers import Tokenizer
 
6
 
7
 
8
  # Regular expression matching whitespace:
@@ -165,6 +166,8 @@ def lev_distance(s1, s2):
165
 
166
  class VoiceBpeTokenizer:
167
  def __init__(self, vocab_file='data/tokenizer.json'):
 
 
168
  if vocab_file is not None:
169
  self.tokenizer = Tokenizer.from_file(vocab_file)
170
 
 
3
  import inflect
4
  import torch
5
  from tokenizers import Tokenizer
6
+ from pathlib import Path
7
 
8
 
9
  # Regular expression matching whitespace:
 
166
 
167
  class VoiceBpeTokenizer:
168
  def __init__(self, vocab_file='data/tokenizer.json'):
169
+ vocab_file = str(Path(__file__).parent.parent / Path(vocab_file))
170
+ print(vocab_file)
171
  if vocab_file is not None:
172
  self.tokenizer = Tokenizer.from_file(vocab_file)
173
 
{utils β†’ tortoise_tts/utils}/typical_sampling.py RENAMED
File without changes
tortoise_tts/voices/__init__.py ADDED
File without changes