class_docstr: ⓍTTS model implementation.
  
  ❗ Currently it only supports inference.
  
  Examples:
      >>> from TTS.tts.configs.xtts_config import XttsConfig
      >>> from TTS.tts.models.xtts import Xtts
      >>> config = XttsConfig()
      >>> model = Xtts.inif_from_config(config)
      >>> model.load_checkpoint(config, checkpoint_dir="paths/to/models_dir/", eval=True)
class_docstr_tok: ["\u24cdTTS","model","implementation",".","\u2757","Currently","it","only","supports","inference",".","Examples",":",">",">",">","from","TTS.tts.configs.xtts_config","import","XttsConfig",">",">",">","from","TTS.tts.models.xtts","import","Xtts",">",">",">","config","=","XttsConfig","(",")",">",">",">","model","=","Xtts.inif_from_config","(","config",")",">",">",">","model.load_checkpoint","(","config",",","checkpoint_dir=","''","paths\/to\/models_dir\/","''",",","eval=True",")"]
docstr: Initialize the models. We do it here since we need to load the tokenizer first.
docstr_tok: ["Initialize","the","models",".","We","do","it","here","since","we","need","to","load","the","tokenizer","first","."]
code: def init_models(self):
      """Initialize the models. We do it here since we need to load the tokenizer first."""
      if self.tokenizer.tokenizer is not None:
          self.args.gpt_number_text_tokens = (
              self.tokenizer.get_number_tokens()
          )
          self.args.gpt_start_text_token = (
              self.tokenizer.tokenizer.token_to_id("[START]")
          )
          self.args.gpt_stop_text_token = (
              self.tokenizer.tokenizer.token_to_id("[STOP]")
          )
  
      if self.args.gpt_number_text_tokens:
          self.gpt = GPT(
              layers=self.args.gpt_layers,
              model_dim=self.args.gpt_n_model_channels,
              start_text_token=self.args.gpt_start_text_token,
              stop_text_token=self.args.gpt_stop_text_token,
              heads=self.args.gpt_n_heads,
              max_text_tokens=self.args.gpt_max_text_tokens,
              max_mel_tokens=self.args.gpt_max_audio_tokens,
              max_prompt_tokens=self.args.gpt_max_prompt_tokens,
              number_text_tokens=self.args.gpt_number_text_tokens,
              num_audio_tokens=self.args.gpt_num_audio_tokens,
              start_audio_token=self.args.gpt_start_audio_token,
              stop_audio_token=self.args.gpt_stop_audio_token,
              use_perceiver_resampler=self.args.gpt_use_perceiver_resampler,
              code_stride_len=self.args.gpt_code_stride_len,
          )
  
      self.hifigan_decoder = HifiDecoder(
          input_sample_rate=self.args.input_sample_rate,
          output_sample_rate=self.args.output_sample_rate,
          output_hop_length=self.args.output_hop_length,
          ar_mel_length_compression=self.args.gpt_code_stride_len,
          decoder_input_dim=self.args.decoder_input_dim,
          d_vector_dim=self.args.d_vector_dim,
          cond_d_vector_in_each_upsampling_layer=self.args.cond_d_vector_in_each_upsampling_layer,
      )
  
imports: import os
  from dataclasses import dataclass
  import librosa
  import torch
  import torch.nn.functional
  import torchaudio
  from coqpit import Coqpit
  from TTS.tts.layers.xtts.gpt import GPT
  from TTS.tts.layers.xtts.hifigan_decoder import HifiDecoder
  from TTS.tts.layers.xtts.stream_generator import init_stream_support
  from TTS.tts.layers.xtts.tokenizer import VoiceBpeTokenizer, split_sentence
  from TTS.tts.layers.xtts.xtts_manager import SpeakerManager, LanguageManager
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 2 for calling the Xtts obj's underlying member method code with example usage: obj.init_models() without return types