code: def _set_up_model(self, config, pipeline, device):
      # set up trainer
      model_paths = config.get("model_path")
      if isinstance(model_paths, str):
          model_paths = model_paths.split(";")
  
      charlm_forward_files = self._get_dependencies(
          config, "forward_charlm_path"
      )
      charlm_backward_files = self._get_dependencies(
          config, "backward_charlm_path"
      )
      pretrain_files = self._get_dependencies(config, "pretrain_path")
  
      # allow predict_tagset to be specified as an int
      # (which only applies to the first model)
      # or as a string ";" separated list of ints
      self._predict_tagset = {}
      predict_tagset = config.get("predict_tagset", None)
      if predict_tagset:
          if isinstance(predict_tagset, int):
              self._predict_tagset[0] = predict_tagset
          else:
              predict_tagset = predict_tagset.split(";")
              for piece_idx, piece in enumerate(predict_tagset):
                  if piece:
                      self._predict_tagset[piece_idx] = int(piece)
  
      self.trainers = []
      for (
          model_path,
          pretrain_path,
          charlm_forward,
          charlm_backward,
      ) in zip(
          model_paths,
          pretrain_files,
          charlm_forward_files,
          charlm_backward_files,
      ):
          logger.debug(
              "Loading %s with pretrain %s, forward charlm %s, backward charlm %s",
              model_path,
              pretrain_path,
              charlm_forward,
              charlm_backward,
          )
          pretrain = (
              pipeline.foundation_cache.load_pretrain(pretrain_path)
              if pretrain_path
              else None
          )
          args = {
              "charlm_forward_file": charlm_forward,
              "charlm_backward_file": charlm_backward,
          }
  
          predict_tagset = self._predict_tagset.get(
              len(self.trainers), None
          )
          if predict_tagset is not None:
              args["predict_tagset"] = predict_tagset
  
          try:
              trainer = Trainer(
                  args=args,
                  model_file=model_path,
                  pretrain=pretrain,
                  device=device,
                  foundation_cache=pipeline.foundation_cache,
              )
          except ForwardCharlmNotFoundError as e:
              raise ForwardCharlmNotFoundError(
                  "Could not find the forward charlm %s.  Please specify the correct path with ner_forward_charlm_path"
                  % e.filename,
                  e.filename,
              ) from None
          except BackwardCharlmNotFoundError as e:
              raise BackwardCharlmNotFoundError(
                  "Could not find the backward charlm %s.  Please specify the correct path with ner_backward_charlm_path"
                  % e.filename,
                  e.filename,
              ) from None
          self.trainers.append(trainer)
  
      self._trainer = self.trainers[0]
      self.model_paths = model_paths
  
file_path: stanza/stanza/pipeline/ner_processor.py
imports: import torch
  import logging
  from stanza.models.common import doc
  from stanza.models.common.exceptions import ForwardCharlmNotFoundError, BackwardCharlmNotFoundError
  from stanza.models.common.utils import unsort
  from stanza.models.ner.data import DataLoader
  from stanza.models.ner.trainer import Trainer
  from stanza.models.ner.utils import merge_tags
  from stanza.pipeline._constants import *
  from stanza.pipeline.processor import UDProcessor, register_processor
label_desc: Use image node_id 2 for calling the NERProcessor obj's underlying member method code with example usage: obj._set_up_model(config, pipeline, device) without return types