code: def setup_encoder_model(config: "Coqpit"):
      if config.model_params["model_name"].lower() == "lstm":
          model = LSTMSpeakerEncoder(
              config.model_params["input_dim"],
              config.model_params["proj_dim"],
              config.model_params["lstm_dim"],
              config.model_params["num_lstm_layers"],
              use_torch_spec=config.model_params.get(
                  "use_torch_spec", False
              ),
              audio_config=config.audio,
          )
      elif config.model_params["model_name"].lower() == "resnet":
          model = ResNetSpeakerEncoder(
              input_dim=config.model_params["input_dim"],
              proj_dim=config.model_params["proj_dim"],
              log_input=config.model_params.get("log_input", False),
              use_torch_spec=config.model_params.get(
                  "use_torch_spec", False
              ),
              audio_config=config.audio,
          )
      return model
  
file_path: TTS/TTS/encoder/utils/generic_utils.py
imports: import glob
  import os
  import random
  import numpy
  from scipy import signal
  from TTS.encoder.models.lstm import LSTMSpeakerEncoder
  from TTS.encoder.models.resnet import ResNetSpeakerEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: setup_encoder_model(config) and returns: model