class_docstr: Speech2Speech class.
docstr: Build Text2Speech instance from the pretrained model.
  
  Args:
      vocoder_tag (Optional[str]): Vocoder tag of the pretrained vocoders.
          Currently, the tags of parallel_wavegan are supported, which should
          start with the prefix "parallel_wavegan/".
  
  Returns:
      Text2Speech: Text2Speech instance.
code: def from_pretrained(
      vocoder_tag: Optional[str] = None,
      **kwargs: Optional[Any],
  ):
      """Build Text2Speech instance from the pretrained model.
  
      Args:
          vocoder_tag (Optional[str]): Vocoder tag of the pretrained vocoders.
              Currently, the tags of parallel_wavegan are supported, which should
              start with the prefix "parallel_wavegan/".
  
      Returns:
          Text2Speech: Text2Speech instance.
  
      """
  
      if vocoder_tag is not None:
          if vocoder_tag.startswith("parallel_wavegan/"):
              try:
                  from parallel_wavegan.utils import (
                      download_pretrained_model,
                  )
  
              except ImportError:
                  logging.error(
                      "`parallel_wavegan` is not installed. "
                      "Please install via `pip install -U parallel_wavegan`."
                  )
                  raise
  
              from parallel_wavegan import __version__
  
              # NOTE(kan-bayashi): Filelock download is supported from 0.5.2
              assert V(__version__) > V("0.5.1"), (
                  "Please install the latest parallel_wavegan "
                  "via `pip install -U parallel_wavegan`."
              )
              vocoder_tag = vocoder_tag.replace("parallel_wavegan/", "")
              vocoder_file = download_pretrained_model(vocoder_tag)
              vocoder_config = Path(vocoder_file).parent / "config.yml"
              kwargs.update(
                  vocoder_config=vocoder_config,
                  vocoder_file=vocoder_file,
              )
  
          else:
              raise ValueError(f"{vocoder_tag} is unsupported format.")
  
      return Speech2Speech(**kwargs)
  
imports: import argparse
  import logging
  import shutil
  import sys
  import time
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import soundfile
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types
  from espnet2.fileio.datadir_writer import DatadirWriter
  from espnet2.fileio.npy_scp import NpyScpWriter
  from espnet2.tasks.s2st import S2STTask
  from espnet2.text.build_tokenizer import build_tokenizer
  from espnet2.text.token_id_converter import TokenIDConverter
  from espnet2.torch_utils.device_funcs import to_device
  from espnet2.torch_utils.set_all_random_seed import set_all_random_seed
  from espnet2.utils import config_argparse
  from espnet2.utils.types import str2bool, str2triple_str, str_or_none
  from espnet.nets.batch_beam_search import BatchBeamSearch
  from espnet.nets.beam_search import BeamSearch, Hypothesis
  from espnet.nets.pytorch_backend.transformer.subsampling import TooShortUttError
  from espnet.nets.scorer_interface import BatchScorerInterface
  from espnet.nets.scorers.length_bonus import LengthBonus
  from espnet.utils.cli_utils import get_commandline_args
label_desc: Use image node_id 8 for calling the Speech2Speech obj's underlying member method code with example usage: obj.from_pretrained(vocoder_tag) and returns: Speech2Speech