class_docstr: The torchserve side inference and explain end-points requests are handled to
  return a KServe side response
  
  Args:
      kserve.KFModel(class object): The predict and explain methods are overridden by torchserve
      side predict and explain http requests.
docstr: The Model Name, Inference Address, Management Address and the model directory
  are specified.
  
  Args:
      name (str): Model Name
      inference_address (str): The Inference Address in which we hit the inference end point
      management_address (str): The Management Address in which we register the model.
      model_dir (str): The location of the model artifacts.
docstr_tok: ["The","Model","Name",",","Inference","Address",",","Management","Address","and","the","model","directory","are","specified",".","Args",":","name","(","str",")",":","Model","Name","inference_address","(","str",")",":","The","Inference","Address","in","which","we","hit","the","inference","end","point","management_address","(","str",")",":","The","Management","Address","in","which","we","register","the","model",".","model_dir","(","str",")",":","The","location","of","the","model","artifacts","."]
code: def __init__(
      self,
      name,
      inference_address,
      management_address,
      grpc_inference_address,
      protocol,
      model_dir,
  ):
      """The Model Name, Inference Address, Management Address and the model directory
      are specified.
  
      Args:
          name (str): Model Name
          inference_address (str): The Inference Address in which we hit the inference end point
          management_address (str): The Management Address in which we register the model.
          model_dir (str): The location of the model artifacts.
      """
      super().__init__(name)
  
      if not self.predictor_host:
          self.predictor_host = inference_address.split("//")[1]
      if not self.explainer_host:
          self.explainer_host = self.predictor_host
  
      self.inference_address = inference_address
      self.management_address = management_address
      self.model_dir = model_dir
      self.protocol = protocol
  
      if self.protocol == PredictorProtocol.GRPC_V2.value:
          self.predictor_host = grpc_inference_address
  
      logging.info("Predict URL set to %s", self.predictor_host)
      logging.info("Explain URL set to %s", self.explainer_host)
      logging.info("Protocol version is %s", self.protocol)
  
imports: import logging
  import pathlib
  from enum import Enum
  from typing import Dict, Union
  import grpc
  import inference_pb2_grpc
  import kserve
  from gprc_utils import from_ts_grpc, to_ts_grpc
  from inference_pb2 import PredictionResponse
  from kserve.errors import ModelMissingError
  from kserve.model import Model
  from kserve.protocol.grpc.grpc_predict_v2_pb2 import ModelInferRequest, ModelInferResponse
  from kserve.protocol.infer_type import InferRequest, InferResponse
  from kserve.storage import Storage
label_desc: Use image node_id 1 to create a new TorchserveModel object from inherited base classes: Model with example: obj = TorchserveModel(name, inference_address, management_address, grpc_inference_address, protocol, model_dir)