class_docstr: An GluonTS SageMaker ``Model`` that can be deployed to a SageMaker
  ``Endpoint``.
docstr: Return a container definition with framework configuration set in model
  environment variables.
  
  Parameters
  ----------
  instance_type:
      The EC2 instance type to deploy this Model to.
      Example::
  
          'ml.c5.xlarge' # CPU,
          'ml.p2.xlarge' # GPU.
  
  accelerator_type:
      The Elastic Inference accelerator type to
      deploy to the instance for loading and making inferences to the model.
      Example::
  
          "ml.eia1.medium"
  
  Returns
  --------
  Dict[str, str]:
      A container definition object usable with the CreateModel API.
docstr_tok: ["Return","a","container","definition","with","framework","configuration","set","in","model","environment","variables",".","Parameters","--","--","--","--","--","instance_type",":","The","EC2","instance","type","to","deploy","this","Model","to",".","Example",":",":","'ml.c5.xlarge","'","#","CPU",",","'ml.p2.xlarge","'","#","GPU",".","accelerator_type",":","The","Elastic","Inference","accelerator","type","to","deploy","to","the","instance","for","loading","and","making","inferences","to","the","model",".","Example",":",":","``","ml.eia1.medium","''","Returns","--","--","--","--","Dict","[","str",",","str","]",":","A","container","definition","object","usable","with","the","CreateModel","API","."]
code: def prepare_container_def(
      self, instance_type, accelerator_type=None
  ) -> Dict[str, str]:
      """
      Return a container definition with framework configuration set in model
      environment variables.
  
      Parameters
      ----------
      instance_type:
          The EC2 instance type to deploy this Model to.
          Example::
  
              'ml.c5.xlarge' # CPU,
              'ml.p2.xlarge' # GPU.
  
      accelerator_type:
          The Elastic Inference accelerator type to
          deploy to the instance for loading and making inferences to the model.
          Example::
  
              "ml.eia1.medium"
  
      Returns
      --------
      Dict[str, str]:
          A container definition object usable with the CreateModel API.
      """
  
      is_mms_version = parse_version(
          self.framework_version
      ) >= parse_version(self._LOWEST_MMS_VERSION)
  
      deploy_image = self.image
  
      # TODO implement proper logic handling images when none are provided by user
      # Example implementation:
      #   https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/mxnet/model.py
  
      logger.info(f"Using image: {deploy_image}")
  
      deploy_key_prefix = model_code_key_prefix(
          self.key_prefix, self.name, deploy_image
      )
      self._upload_code(deploy_key_prefix, is_mms_version)
      deploy_env = dict(self.env)
      deploy_env.update(self._framework_env_vars())
  
      if self.model_server_workers:
          deploy_env[MODEL_SERVER_WORKERS_PARAM_NAME.upper()] = str(
              self.model_server_workers
          )
      return sagemaker.container_def(
          deploy_image,
          self.repacked_model_data or self.model_data,
          deploy_env,
      )
  
file_path: gluonts/src/gluonts/nursery/sagemaker_sdk/model.py
imports: import logging
  from typing import Dict
  import sagemaker
  from pkg_resources import parse_version
  from sagemaker import session
  from sagemaker.fw_utils import model_code_key_prefix
  from sagemaker.model import MODEL_SERVER_WORKERS_PARAM_NAME, FrameworkModel
  from sagemaker.predictor import RealTimePredictor, json_deserializer, json_serializer
  from .defaults import FRAMEWORK_NAME, GLUONTS_VERSION, LOWEST_MMS_VERSION
label_desc: Use image node_id 2 for calling the GluonTSModel obj's underlying member method code with example usage: obj.prepare_container_def(instance_type, accelerator_type) and returns: sagemaker