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: Get the conditioning latents for the GPT model from the given audio.
  
  Args:
      audio_path (str or List[str]): Path to reference audio file(s).
      max_ref_length (int): Maximum length of each reference audio in seconds. Defaults to 30.
      gpt_cond_len (int): Length of the audio used for gpt latents. Defaults to 6.
      gpt_cond_chunk_len (int): Chunk length used for gpt latents. It must be <= gpt_conf_len. Defaults to 6.
      librosa_trim_db (int, optional): Trim the audio using this value. If None, not trimming. Defaults to None.
      sound_norm_refs (bool, optional): Whether to normalize the audio. Defaults to False.
      load_sr (int, optional): Sample rate to load the audio. Defaults to 24000.
docstr_tok: ["Get","the","conditioning","latents","for","the","GPT","model","from","the","given","audio",".","Args",":","audio_path","(","str","or","List","[","str","]",")",":","Path","to","reference","audio","file","(","s",")",".","max_ref_length","(","int",")",":","Maximum","length","of","each","reference","audio","in","seconds",".","Defaults","to","30.","gpt_cond_len","(","int",")",":","Length","of","the","audio","used","for","gpt","latents",".","Defaults","to","6.","gpt_cond_chunk_len","(","int",")",":","Chunk","length","used","for","gpt","latents",".","It","must","be","<","=","gpt_conf_len",".","Defaults","to","6.","librosa_trim_db","(","int",",","optional",")",":","Trim","the","audio","using","this","value",".","If","None",",","not","trimming",".","Defaults","to","None",".","sound_norm_refs","(","bool",",","optional",")",":","Whether","to","normalize","the","audio",".","Defaults","to","False",".","load_sr","(","int",",","optional",")",":","Sample","rate","to","load","the","audio",".","Defaults","to","24000","."]
code: def get_conditioning_latents(
      self,
      audio_path,
      max_ref_length=30,
      gpt_cond_len=6,
      gpt_cond_chunk_len=6,
      librosa_trim_db=None,
      sound_norm_refs=False,
      load_sr=22050,
  ):
      """Get the conditioning latents for the GPT model from the given audio.
  
      Args:
          audio_path (str or List[str]): Path to reference audio file(s).
          max_ref_length (int): Maximum length of each reference audio in seconds. Defaults to 30.
          gpt_cond_len (int): Length of the audio used for gpt latents. Defaults to 6.
          gpt_cond_chunk_len (int): Chunk length used for gpt latents. It must be <= gpt_conf_len. Defaults to 6.
          librosa_trim_db (int, optional): Trim the audio using this value. If None, not trimming. Defaults to None.
          sound_norm_refs (bool, optional): Whether to normalize the audio. Defaults to False.
          load_sr (int, optional): Sample rate to load the audio. Defaults to 24000.
      """
      # deal with multiples references
      if not isinstance(audio_path, list):
          audio_paths = [audio_path]
      else:
          audio_paths = audio_path
  
      speaker_embeddings = []
      audios = []
      speaker_embedding = None
      for file_path in audio_paths:
          audio = load_audio(file_path, load_sr)
          audio = audio[:, : load_sr * max_ref_length].to(self.device)
          if sound_norm_refs:
              audio = (audio / torch.abs(audio).max()) * 0.75
          if librosa_trim_db is not None:
              audio = librosa.effects.trim(
                  audio, top_db=librosa_trim_db
              )[0]
  
          # compute latents for the decoder
          speaker_embedding = self.get_speaker_embedding(audio, load_sr)
          speaker_embeddings.append(speaker_embedding)
  
          audios.append(audio)
  
      # merge all the audios and compute the latents for the gpt
      full_audio = torch.cat(audios, dim=-1)
      gpt_cond_latents = self.get_gpt_cond_latents(
          full_audio,
          load_sr,
          length=gpt_cond_len,
          chunk_length=gpt_cond_chunk_len,
      )  # [1, 1024, T]
  
      if speaker_embeddings:
          speaker_embedding = torch.stack(speaker_embeddings)
          speaker_embedding = speaker_embedding.mean(dim=0)
  
      return gpt_cond_latents, speaker_embedding
  
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 6 for calling the Xtts obj's underlying member method code with example usage: obj.get_conditioning_latents(audio_path, max_ref_length, gpt_cond_len, gpt_cond_chunk_len, librosa_trim_db, sound_norm_refs, load_sr) and returns: gpt_cond_latents,  speaker_embedding