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: Synthesize speech with the given input text.
  
  Args:
      text (str): Input text.
      config (XttsConfig): Config with inference parameters.
      speaker_wav (list): List of paths to the speaker audio files to be used for cloning.
      language (str): Language ID of the speaker.
      **kwargs: Inference settings. See `inference()`.
  
  Returns:
      A dictionary of the output values with `wav` as output waveform, `deterministic_seed` as seed used at inference,
      `text_input` as text token IDs after tokenizer, `voice_samples` as samples used for cloning, `conditioning_latents`
      as latents used at inference.
docstr_tok: ["Synthesize","speech","with","the","given","input","text",".","Args",":","text","(","str",")",":","Input","text",".","config","(","XttsConfig",")",":","Config","with","inference","parameters",".","speaker_wav","(","list",")",":","List","of","paths","to","the","speaker","audio","files","to","be","used","for","cloning",".","language","(","str",")",":","Language","ID","of","the","speaker",".","*","*","kwargs",":","Inference","settings",".","See","`","inference","(",")","`",".","Returns",":","A","dictionary","of","the","output","values","with","`","wav","`","as","output","waveform",",","`","deterministic_seed","`","as","seed","used","at","inference",",","`","text_input","`","as","text","token","IDs","after","tokenizer",",","`","voice_samples","`","as","samples","used","for","cloning",",","`","conditioning_latents","`","as","latents","used","at","inference","."]
code: def synthesize(
      self,
      text,
      config,
      speaker_wav,
      language,
      speaker_id=None,
      **kwargs,
  ):
      """Synthesize speech with the given input text.
  
      Args:
          text (str): Input text.
          config (XttsConfig): Config with inference parameters.
          speaker_wav (list): List of paths to the speaker audio files to be used for cloning.
          language (str): Language ID of the speaker.
          **kwargs: Inference settings. See `inference()`.
  
      Returns:
          A dictionary of the output values with `wav` as output waveform, `deterministic_seed` as seed used at inference,
          `text_input` as text token IDs after tokenizer, `voice_samples` as samples used for cloning, `conditioning_latents`
          as latents used at inference.
  
      """
      assert (
          "zh-cn"
          if language == "zh"
          else language in self.config.languages
      ), f" ❗ Language {language} is not supported. Supported languages are {self.config.languages}"
      # Use generally found best tuning knobs for generation.
      settings = {
          "temperature": config.temperature,
          "length_penalty": config.length_penalty,
          "repetition_penalty": config.repetition_penalty,
          "top_k": config.top_k,
          "top_p": config.top_p,
      }
      settings.update(
          kwargs
      )  # allow overriding of preset settings with kwargs
      if speaker_id is not None:
          (
              gpt_cond_latent,
              speaker_embedding,
          ) = self.speaker_manager.speakers[speaker_id].values()
          return self.inference(
              text,
              language,
              gpt_cond_latent,
              speaker_embedding,
              **settings,
          )
      settings.update(
          {
              "gpt_cond_len": config.gpt_cond_len,
              "gpt_cond_chunk_len": config.gpt_cond_chunk_len,
              "max_ref_len": config.max_ref_len,
              "sound_norm_refs": config.sound_norm_refs,
          }
      )
      return self.full_inference(
          text, speaker_wav, language, **settings
      )
  
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 7 for calling the Xtts obj's underlying member method code with example usage: obj.synthesize(text, config, speaker_wav, language, speaker_id) and returns: self, self