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: This function produces an audio clip of the given text being spoken with the given reference voice.
  
  Args:
      text: (str) Text to be spoken.
  
      ref_audio_path: (str) Path to a reference audio file to be used for cloning. This audio file should be >3
          seconds long.
  
      language: (str) Language of the voice to be generated.
  
      temperature: (float) The softmax temperature of the autoregressive model. Defaults to 0.65.
  
      length_penalty: (float) A length penalty applied to the autoregressive decoder. Higher settings causes the
          model to produce more terse outputs. Defaults to 1.0.
  
      repetition_penalty: (float) A penalty that prevents the autoregressive decoder from repeating itself during
          decoding. Can be used to reduce the incidence of long silences or "uhhhhhhs", etc. Defaults to 2.0.
  
      top_k: (int) K value used in top-k sampling. [0,inf]. Lower values mean the decoder produces more "likely"
          (aka boring) outputs. Defaults to 50.
  
      top_p: (float) P value used in nucleus sampling. (0,1]. Lower values mean the decoder produces more "likely"
          (aka boring) outputs. Defaults to 0.8.
  
      gpt_cond_len: (int) Length of the audio used for cloning. If audio is shorter, then audio length is used
          else the first `gpt_cond_len` secs is used. Defaults to 30 seconds.
  
      gpt_cond_chunk_len: (int) Chunk length used for cloning. It must be <= `gpt_cond_len`.
          If gpt_cond_len == gpt_cond_chunk_len, no chunking. Defaults to 6 seconds.
  
      hf_generate_kwargs: (**kwargs) The huggingface Transformers generate API is used for the autoregressive
          transformer. Extra keyword args fed to this function get forwarded directly to that API. Documentation
          here: https://huggingface.co/docs/transformers/internal/generation_utils
  
  Returns:
      Generated audio clip(s) as a torch tensor. Shape 1,S if k=1 else, (k,1,S) where S is the sample length.
      Sample rate is 24kHz.
docstr_tok: ["This","function","produces","an","audio","clip","of","the","given","text","being","spoken","with","the","given","reference","voice",".","Args",":","text",":","(","str",")","Text","to","be","spoken",".","ref_audio_path",":","(","str",")","Path","to","a","reference","audio","file","to","be","used","for","cloning",".","This","audio","file","should","be",">","3","seconds","long",".","language",":","(","str",")","Language","of","the","voice","to","be","generated",".","temperature",":","(","float",")","The","softmax","temperature","of","the","autoregressive","model",".","Defaults","to","0.65.","length_penalty",":","(","float",")","A","length","penalty","applied","to","the","autoregressive","decoder",".","Higher","settings","causes","the","model","to","produce","more","terse","outputs",".","Defaults","to","1.0.","repetition_penalty",":","(","float",")","A","penalty","that","prevents","the","autoregressive","decoder","from","repeating","itself","during","decoding",".","Can","be","used","to","reduce","the","incidence","of","long","silences","or","``","uhhhhhhs","''",",","etc",".","Defaults","to","2.0.","top_k",":","(","int",")","K","value","used","in","top-k","sampling",".","[","0",",","inf","]",".","Lower","values","mean","the","decoder","produces","more","``","likely","''","(","aka","boring",")","outputs",".","Defaults","to","50.","top_p",":","(","float",")","P","value","used","in","nucleus","sampling",".","(","0,1","]",".","Lower","values","mean","the","decoder","produces","more","``","likely","''","(","aka","boring",")","outputs",".","Defaults","to","0.8.","gpt_cond_len",":","(","int",")","Length","of","the","audio","used","for","cloning",".","If","audio","is","shorter",",","then","audio","length","is","used","else","the","first","`","gpt_cond_len","`","secs","is","used",".","Defaults","to","30","seconds",".","gpt_cond_chunk_len",":","(","int",")","Chunk","length","used","for","cloning",".","It","must","be","<","=","`","gpt_cond_len","`",".","If","gpt_cond_len","==","gpt_cond_chunk_len",",","no","chunking",".","Defaults","to","6","seconds",".","hf_generate_kwargs",":","(","*","*","kwargs",")","The","huggingface","Transformers","generate","API","is","used","for","the","autoregressive","transformer",".","Extra","keyword","args","fed","to","this","function","get","forwarded","directly","to","that","API",".","Documentation","here",":","https",":","\/\/huggingface.co\/docs\/transformers\/internal\/generation_utils","Returns",":","Generated","audio","clip","(","s",")","as","a","torch","tensor",".","Shape","1",",","S","if","k=1","else",",","(","k,1",",","S",")","where","S","is","the","sample","length",".","Sample","rate","is","24kHz","."]
code: def full_inference(
      self,
      text,
      ref_audio_path,
      language,
      # GPT inference
      temperature=0.75,
      length_penalty=1.0,
      repetition_penalty=10.0,
      top_k=50,
      top_p=0.85,
      do_sample=True,
      # Cloning
      gpt_cond_len=30,
      gpt_cond_chunk_len=6,
      max_ref_len=10,
      sound_norm_refs=False,
      **hf_generate_kwargs,
  ):
      """
      This function produces an audio clip of the given text being spoken with the given reference voice.
  
      Args:
          text: (str) Text to be spoken.
  
          ref_audio_path: (str) Path to a reference audio file to be used for cloning. This audio file should be >3
              seconds long.
  
          language: (str) Language of the voice to be generated.
  
          temperature: (float) The softmax temperature of the autoregressive model. Defaults to 0.65.
  
          length_penalty: (float) A length penalty applied to the autoregressive decoder. Higher settings causes the
              model to produce more terse outputs. Defaults to 1.0.
  
          repetition_penalty: (float) A penalty that prevents the autoregressive decoder from repeating itself during
              decoding. Can be used to reduce the incidence of long silences or "uhhhhhhs", etc. Defaults to 2.0.
  
          top_k: (int) K value used in top-k sampling. [0,inf]. Lower values mean the decoder produces more "likely"
              (aka boring) outputs. Defaults to 50.
  
          top_p: (float) P value used in nucleus sampling. (0,1]. Lower values mean the decoder produces more "likely"
              (aka boring) outputs. Defaults to 0.8.
  
          gpt_cond_len: (int) Length of the audio used for cloning. If audio is shorter, then audio length is used
              else the first `gpt_cond_len` secs is used. Defaults to 30 seconds.
  
          gpt_cond_chunk_len: (int) Chunk length used for cloning. It must be <= `gpt_cond_len`.
              If gpt_cond_len == gpt_cond_chunk_len, no chunking. Defaults to 6 seconds.
  
          hf_generate_kwargs: (**kwargs) The huggingface Transformers generate API is used for the autoregressive
              transformer. Extra keyword args fed to this function get forwarded directly to that API. Documentation
              here: https://huggingface.co/docs/transformers/internal/generation_utils
  
      Returns:
          Generated audio clip(s) as a torch tensor. Shape 1,S if k=1 else, (k,1,S) where S is the sample length.
          Sample rate is 24kHz.
      """
      (
          gpt_cond_latent,
          speaker_embedding,
      ) = self.get_conditioning_latents(
          audio_path=ref_audio_path,
          gpt_cond_len=gpt_cond_len,
          gpt_cond_chunk_len=gpt_cond_chunk_len,
          max_ref_length=max_ref_len,
          sound_norm_refs=sound_norm_refs,
      )
  
      return self.inference(
          text,
          language,
          gpt_cond_latent,
          speaker_embedding,
          temperature=temperature,
          length_penalty=length_penalty,
          repetition_penalty=repetition_penalty,
          top_k=top_k,
          top_p=top_p,
          do_sample=do_sample,
          **hf_generate_kwargs,
      )
  
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 8 for calling the Xtts obj's underlying member method code with example usage: obj.full_inference(text, ref_audio_path, language, temperature, length_penalty, repetition_penalty, top_k, top_p, do_sample, gpt_cond_len, gpt_cond_chunk_len, max_ref_len, sound_norm_refs) and returns: self