class_docstr: CLIP model retrofitted for performing contrastive evaluation between tokenized audio data and the corresponding
  transcribed text.
  
  Originally from https://github.com/lucidrains/DALLE-pytorch/blob/main/dalle_pytorch/dalle_pytorch.py
class_docstr_tok: ["CLIP","model","retrofitted","for","performing","contrastive","evaluation","between","tokenized","audio","data","and","the","corresponding","transcribed","text",".","Originally","from","https",":","\/\/github.com\/lucidrains\/DALLE-pytorch\/blob\/main\/dalle_pytorch\/dalle_pytorch.py"]
code: def __init__(
      self,
      *,
      dim_text=512,
      dim_speech=512,
      dim_latent=512,
      num_text_tokens=256,
      text_enc_depth=6,
      text_seq_len=120,
      text_heads=8,
      num_speech_tokens=8192,
      speech_enc_depth=6,
      speech_heads=8,
      speech_seq_len=250,
      text_mask_percentage=0,
      voice_mask_percentage=0,
      wav_token_compression=1024,
      use_xformers=False,
  ):
      super().__init__()
      self.text_emb = nn.Embedding(num_text_tokens, dim_text)
      self.to_text_latent = nn.Linear(dim_text, dim_latent, bias=False)
  
      self.speech_emb = nn.Embedding(num_speech_tokens, dim_speech)
      self.to_speech_latent = nn.Linear(
          dim_speech, dim_latent, bias=False
      )
  
      if use_xformers:
          self.text_transformer = CheckpointedXTransformerEncoder(
              needs_permute=False,
              exit_permute=False,
              max_seq_len=-1,
              attn_layers=Encoder(
                  dim=dim_text,
                  depth=text_enc_depth,
                  heads=text_heads,
                  ff_dropout=0.1,
                  ff_mult=2,
                  attn_dropout=0.1,
                  use_rmsnorm=True,
                  ff_glu=True,
                  rotary_pos_emb=True,
              ),
          )
          self.speech_transformer = CheckpointedXTransformerEncoder(
              needs_permute=False,
              exit_permute=False,
              max_seq_len=-1,
              attn_layers=Encoder(
                  dim=dim_speech,
                  depth=speech_enc_depth,
                  heads=speech_heads,
                  ff_dropout=0.1,
                  ff_mult=2,
                  attn_dropout=0.1,
                  use_rmsnorm=True,
                  ff_glu=True,
                  rotary_pos_emb=True,
              ),
          )
      else:
          self.text_transformer = Transformer(
              causal=False,
              seq_len=text_seq_len,
              dim=dim_text,
              depth=text_enc_depth,
              heads=text_heads,
          )
          self.speech_transformer = Transformer(
              causal=False,
              seq_len=speech_seq_len,
              dim=dim_speech,
              depth=speech_enc_depth,
              heads=speech_heads,
          )
  
      self.temperature = nn.Parameter(torch.tensor(1.0))
      self.text_mask_percentage = text_mask_percentage
      self.voice_mask_percentage = voice_mask_percentage
      self.wav_token_compression = wav_token_compression
      self.xformers = use_xformers
      if not use_xformers:
          self.text_pos_emb = nn.Embedding(text_seq_len, dim_text)
          self.speech_pos_emb = nn.Embedding(
              num_speech_tokens, dim_speech
          )
  
file_path: TTS/TTS/tts/layers/tortoise/clvp.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch import einsum
  from TTS.tts.layers.tortoise.arch_utils import CheckpointedXTransformerEncoder
  from TTS.tts.layers.tortoise.transformer import Transformer
  from TTS.tts.layers.tortoise.xtransformers import Encoder
label_desc: Use image node_id 1 to create a new CLVP object from inherited base classes: nn with example: obj = CLVP()