docstr: Initialize properties and load model
docstr_tok: ["Initialize","properties","and","load","model"]
code: def initialize(self, context):
      """Initialize properties and load model"""
      self._context = context
      self.initialized = True
      properties = context.system_properties
  
      # See https://pytorch.org/serve/custom_service.html#handling-model-execution-on-multiple-gpus
      self.device = torch.device(
          "cuda:" + str(properties.get("gpu_id"))
          if torch.cuda.is_available()
          else "cpu"
      )
  
      model_dir = properties.get("model_dir")
      self.processor = AutoProcessor.from_pretrained(model_dir)
      self.model = AutoModelForCTC.from_pretrained(model_dir)
  
file_path: serve/examples/speech2text_wav2vec2/handler.py
imports: import torch
  import torchaudio
  from transformers import AutoProcessor, AutoModelForCTC
  import io
label_desc: Use image node_id 2 for calling the Wav2VecHandler obj's underlying member method code with example usage: obj.initialize(context) without return types