code: def _get_model(type_, params):
      factories = {
          "Wav2Vec2": wav2vec2_model,
          "WavLM": wavlm_model,
      }
      if type_ not in factories:
          raise ValueError(
              f"Supported model types are {tuple(factories.keys())}. Found: {type_}"
          )
      factory = factories[type_]
      return factory(**params)
  
imports: from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torchaudio._internal import load_state_dict_from_url
  from torchaudio.models import wav2vec2_model, Wav2Vec2Model, wavlm_model
label_desc: Use image node_id 1 for calling a global function with example usage: _get_model(type_, params) and returns: factory