class_docstr: A DJL DeepSpeed SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``
docstr: Generates the DJL Serving configuration to use for the model.
  
  The configuration is generated using the arguments passed to the Model during
  initialization. If a serving.properties file is found in ``self.source_dir``,
  those configuration as merged with the Model parameters, with Model parameters taking
  priority.
  
  Args:
      serving_properties: Dictionary containing existing model server configuration
      obtained from ``self.source_dir``. Defaults to None.
  
  Returns:
      dict: The model server configuration to use when deploying this model to SageMaker.
docstr_tok: ["Generates","the","DJL","Serving","configuration","to","use","for","the","model",".","The","configuration","is","generated","using","the","arguments","passed","to","the","Model","during","initialization",".","If","a","serving.properties","file","is","found","in","``","self.source_dir","``",",","those","configuration","as","merged","with","the","Model","parameters",",","with","Model","parameters","taking","priority",".","Args",":","serving_properties",":","Dictionary","containing","existing","model","server","configuration","obtained","from","``","self.source_dir","``",".","Defaults","to","None",".","Returns",":","dict",":","The","model","server","configuration","to","use","when","deploying","this","model","to","SageMaker","."]
code: def generate_serving_properties(
      self, serving_properties=None
  ) -> Dict[str, Any]:
      """Generates the DJL Serving configuration to use for the model.
  
      The configuration is generated using the arguments passed to the Model during
      initialization. If a serving.properties file is found in ``self.source_dir``,
      those configuration as merged with the Model parameters, with Model parameters taking
      priority.
  
      Args:
          serving_properties: Dictionary containing existing model server configuration
          obtained from ``self.source_dir``. Defaults to None.
  
      Returns:
          dict: The model server configuration to use when deploying this model to SageMaker.
      """
  
      serving_properties = super(
          DeepSpeedModel, self
      ).generate_serving_properties(
          serving_properties=serving_properties
      )
      if self.max_tokens:
          serving_properties["option.max_tokens"] = self.max_tokens
      if self.low_cpu_mem_usage:
          serving_properties[
              "option.low_cpu_mem_usage"
          ] = self.low_cpu_mem_usage
      if self.enable_cuda_graph:
          if self.number_of_partitions > 1:
              raise ValueError(
                  "enable_cuda_graph is not supported when tensor_parallel_degree > 1"
              )
          serving_properties[
              "option.enable_cuda_graph"
          ] = self.enable_cuda_graph
      if self.triangular_masking:
          serving_properties[
              "option.triangular_masking"
          ] = self.triangular_masking
      if self.return_tuple:
          serving_properties["option.return_tuple"] = self.return_tuple
      if self.save_mp_checkpoint_path:
          serving_properties[
              "option.save_mp_checkpoint_path"
          ] = self.save_mp_checkpoint_path
      if self.checkpoint:
          serving_properties["option.checkpoint"] = self.checkpoint
  
      return serving_properties
  
imports: from __future__ import absolute_import
  import json
  import logging
  import os.path
  import urllib.request
  from json import JSONDecodeError
  from urllib.error import HTTPError, URLError
  from enum import Enum
  from typing import Optional, Union, Dict, Any, List
  import sagemaker
  from sagemaker import s3, Predictor, image_uris, fw_utils
  from sagemaker.deserializers import JSONDeserializer, BaseDeserializer
  from sagemaker.djl_inference import defaults
  from sagemaker.model import FrameworkModel
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.serializers import JSONSerializer, BaseSerializer
  from sagemaker.session import Session
  from sagemaker.utils import _tmpdir, _create_or_update_code_dir, format_tags
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.estimator import Estimator
  from sagemaker.s3 import S3Uploader
label_desc: Use image node_id 2 for calling the DeepSpeedModel obj's underlying member method code with example usage: obj.generate_serving_properties(serving_properties) and returns: serving_properties