class_docstr: Holds the required method to deploy a model to a SageMaker Endpoint
class_docstr_tok: ["Holds","the","required","method","to","deploy","a","model","to","a","SageMaker","Endpoint"]
docstr: Placeholder docstring
docstr_tok: ["Placeholder","docstring"]
code: def prepare(
      self,
      model_path: str,
      secret_key: str,
      s3_model_data_url: str = None,
      sagemaker_session: Session = None,
      image: str = None,
      jumpstart: bool = False,
  ):
      """Placeholder docstring"""
      try:
          sagemaker_session = sagemaker_session or Session()
      except Exception as e:
          raise Exception(
              "Failed to setup default SageMaker session. Please allow a default "
              + "session to be created or supply `sagemaker_session` into @serve.invoke."
          ) from e
  
      if self.model_server == ModelServer.TORCHSERVE:
          return self._upload_torchserve_artifacts(
              model_path=model_path,
              sagemaker_session=sagemaker_session,
              secret_key=secret_key,
              s3_model_data_url=s3_model_data_url,
              image=image,
          )
  
      if self.model_server == ModelServer.TRITON:
          return self._upload_triton_artifacts(
              model_path=model_path,
              sagemaker_session=sagemaker_session,
              secret_key=secret_key,
              s3_model_data_url=s3_model_data_url,
              image=image,
          )
  
      if self.model_server == ModelServer.DJL_SERVING:
          return self._upload_djl_artifacts(
              model_path=model_path,
              sagemaker_session=sagemaker_session,
              s3_model_data_url=s3_model_data_url,
              image=image,
          )
  
      if self.model_server == ModelServer.TGI:
          return self._upload_tgi_artifacts(
              model_path=model_path,
              sagemaker_session=sagemaker_session,
              s3_model_data_url=s3_model_data_url,
              image=image,
              jumpstart=jumpstart,
          )
  
      raise ValueError(
          "%s model server is not supported" % self.model_server
      )
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/mode/sagemaker_endpoint_mode.py
imports: from __future__ import absolute_import
  from pathlib import Path
  import logging
  from typing import Type
  from sagemaker.session import Session
  from sagemaker.serve.utils.types import ModelServer
  from sagemaker.serve.spec.inference_spec import InferenceSpec
  from sagemaker.serve.model_server.triton.server import SageMakerTritonServer
  from sagemaker.serve.model_server.torchserve.server import SageMakerTorchServe
  from sagemaker.serve.model_server.djl_serving.server import SageMakerDjlServing
  from sagemaker.serve.model_server.tgi.server import SageMakerTgiServing
label_desc: Use image node_id 3 for calling the SageMakerEndpointMode obj's underlying member method code with example usage: obj.prepare(model_path, secret_key, s3_model_data_url, sagemaker_session, image, jumpstart) and returns: self, self, self, self