code: def main():
      parser = argparse.ArgumentParser(description="Evaluate the model")
      parser.add_argument("--ssl_model_ckpt_path", type=str)
      parser.add_argument("--hifi_ckpt_path", type=str)
      parser.add_argument("--fastpitch_ckpt_path", type=str)
      parser.add_argument("--source_audio_path", type=str)
      parser.add_argument(
          "--target_audio_path", type=str
      )  # can be a list seperated by comma
      parser.add_argument("--out_path", type=str)
      parser.add_argument("--source_target_out_pairs", type=str)
      parser.add_argument("--use_unique_tokens", type=int, default=0)
      parser.add_argument("--compute_pitch", type=int, default=0)
      parser.add_argument("--compute_duration", type=int, default=0)
      args = parser.parse_args()
  
      device = "cuda:0" if torch.cuda.is_available() else "cpu"
  
      if args.source_target_out_pairs is not None:
          assert (
              args.source_audio_path is None
          ), "source_audio_path and source_target_out_pairs are mutually exclusive"
          assert (
              args.target_audio_path is None
          ), "target_audio_path and source_target_out_pairs are mutually exclusive"
          assert (
              args.out_path is None
          ), "out_path and source_target_out_pairs are mutually exclusive"
          with open(args.source_target_out_pairs, "r") as f:
              lines = f.readlines()
              source_target_out_pairs = [
                  line.strip().split(";") for line in lines
              ]
      else:
          assert (
              args.source_audio_path is not None
          ), "source_audio_path is required"
          assert (
              args.target_audio_path is not None
          ), "target_audio_path is required"
          if args.out_path is None:
              source_name = os.path.basename(
                  args.source_audio_path
              ).split(".")[0]
              target_name = os.path.basename(
                  args.target_audio_path
              ).split(".")[0]
              args.out_path = "swapped_{}_{}.wav".format(
                  source_name, target_name
              )
  
          source_target_out_pairs = [
              (
                  args.source_audio_path,
                  args.target_audio_path,
                  args.out_path,
              )
          ]
  
      out_paths = [r[2] for r in source_target_out_pairs]
      out_dir = get_base_dir(out_paths)
      if not os.path.exists(out_dir):
          os.makedirs(out_dir)
  
      ssl_model = ssl_tts.SSLDisentangler.load_from_checkpoint(
          args.ssl_model_ckpt_path, strict=False
      )
      ssl_model = ssl_model.to(device)
      ssl_model.eval()
  
      vocoder = hifigan.HifiGanModel.load_from_checkpoint(
          args.hifi_ckpt_path
      ).to(device)
      vocoder.eval()
  
      fastpitch_model = (
          fastpitch_ssl.FastPitchModel_SSL.load_from_checkpoint(
              args.fastpitch_ckpt_path, strict=False
          )
      )
      fastpitch_model = fastpitch_model.to(device)
      fastpitch_model.eval()
      fastpitch_model.non_trainable_models = {"vocoder": vocoder}
      fpssl_sample_rate = fastpitch_model._cfg.sample_rate
  
      wav_featurizer = WaveformFeaturizer(
          sample_rate=fpssl_sample_rate,
          int_values=False,
          augmentor=None,
      )
  
      use_unique_tokens = args.use_unique_tokens == 1
      compute_pitch = args.compute_pitch == 1
      compute_duration = args.compute_duration == 1
  
      for source_target_out in source_target_out_pairs:
          source_audio_path = source_target_out[0]
          target_audio_paths = source_target_out[1].split(",")
          out_path = source_target_out[2]
  
          with torch.no_grad():
              (
                  content_embedding1,
                  _,
                  duration1,
              ) = get_ssl_features_disentangled(
                  ssl_model,
                  wav_featurizer,
                  source_audio_path,
                  emb_type="embedding_and_probs",
                  use_unique_tokens=use_unique_tokens,
                  device=device,
              )
  
              speaker_embedding2 = get_speaker_embedding(
                  ssl_model,
                  wav_featurizer,
                  target_audio_paths,
                  duration=None,
                  device=device,
              )
  
              pitch_contour1 = None
              if not compute_pitch:
                  pitch_contour1 = get_pitch_contour(
                      load_wav(source_audio_path, wav_featurizer),
                      compute_mean_std=True,
                      sample_rate=fpssl_sample_rate,
                  )[None]
                  pitch_contour1 = pitch_contour1.to(device)
  
              wav_generated = fastpitch_model.generate_wav(
                  content_embedding1,
                  speaker_embedding2,
                  pitch_contour=pitch_contour1,
                  compute_pitch=compute_pitch,
                  compute_duration=compute_duration,
                  durs_gt=duration1,
                  dataset_id=0,
              )
              wav_generated = wav_generated[0][0]
              soundfile.write(
                  out_path, wav_generated, fpssl_sample_rate
              )
  
file_path: NeMo/scripts/ssl_tts/ssl_tts_vc.py
imports: import argparse
  import os
  import librosa
  import soundfile
  import torch
  from nemo.collections.asr.parts.preprocessing.features import WaveformFeaturizer
  from nemo.collections.tts.models import fastpitch_ssl, hifigan, ssl_tts
  from nemo.collections.tts.parts.utils.tts_dataset_utils import get_base_dir
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types