code: def main():
      hparams_file, run_opts, overrides = sb.parse_arguments(
          sys.argv[1:]
      )
      with open(hparams_file) as fin:
          hparams = load_hyperpyyaml(fin, overrides)
      sb.utils.distributed.ddp_init_group(run_opts)
  
      sb.create_experiment_directory(
          experiment_directory=hparams["output_folder"],
          hyperparams_to_save=hparams_file,
          overrides=overrides,
      )
  
      from ljspeech_prepare import prepare_ljspeech
  
      sb.utils.distributed.run_on_main(
          prepare_ljspeech,
          kwargs={
              "data_folder": hparams["data_folder"],
              "save_folder": hparams["save_folder"],
              "splits": hparams["splits"],
              "split_ratio": hparams["split_ratio"],
              "model_name": hparams["model"].__class__.__name__,
              "seed": hparams["seed"],
              "pitch_n_fft": hparams["n_fft"],
              "pitch_hop_length": hparams["hop_length"],
              "pitch_min_f0": hparams["min_f0"],
              "pitch_max_f0": hparams["max_f0"],
              "skip_prep": hparams["skip_prep"],
              "use_custom_cleaner": True,
          },
      )
  
      datasets, input_encoder = dataio_prepare(hparams)
  
      # Brain class initialization
      fastspeech2_brain = FastSpeech2Brain(
          modules=hparams["modules"],
          opt_class=hparams["opt_class"],
          hparams=hparams,
          run_opts=run_opts,
          checkpointer=hparams["checkpointer"],
      )
  
      fastspeech2_brain.input_encoder = input_encoder
      # Training
      fastspeech2_brain.fit(
          fastspeech2_brain.hparams.epoch_counter,
          datasets["train"],
          datasets["valid"],
          train_loader_kwargs=hparams["train_dataloader_opts"],
          valid_loader_kwargs=hparams["valid_dataloader_opts"],
      )
  
imports: import os
  import sys
  import torch
  import logging
  import torchaudio
  import numpy
  import speechbrain
  from speechbrain.inference.vocoders import HIFIGAN
  from pathlib import Path
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.data_utils import scalarize
  from speechbrain.inference.text import GraphemeToPhoneme
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types