class_docstr: A Hugging Face SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``.
class_docstr_tok: ["A","Hugging","Face","SageMaker","``","Model","``","that","can","be","deployed","to","a","SageMaker","``","Endpoint","``","."]
docstr: A container definition with framework configuration set in model environment variables.
  
  Args:
      instance_type (str): The EC2 instance type to deploy this Model to.
          For example, 'ml.p2.xlarge'.
      accelerator_type (str): The Elastic Inference accelerator type to
          deploy to the instance for loading and making inferences to the
          model.
      serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig):
          Specifies configuration related to serverless endpoint. Instance type is
          not provided in serverless inference. So this is used to find image URIs.
      inference_tool (str): the tool that will be used to aid in the inference.
          Valid values: "neuron, neuronx, None" (default: None).
      accept_eula (bool): For models that require a Model Access Config, specify True or
          False to indicate whether model terms of use have been accepted.
          The `accept_eula` value must be explicitly defined as `True` in order to
          accept the end-user license agreement (EULA) that some
          models require. (Default: None).
  
  Returns:
      dict[str, str]: A container definition object usable with the
      CreateModel API.
docstr_tok: ["A","container","definition","with","framework","configuration","set","in","model","environment","variables",".","Args",":","instance_type","(","str",")",":","The","EC2","instance","type","to","deploy","this","Model","to",".","For","example",",","'ml.p2.xlarge","'",".","accelerator_type","(","str",")",":","The","Elastic","Inference","accelerator","type","to","deploy","to","the","instance","for","loading","and","making","inferences","to","the","model",".","serverless_inference_config","(","sagemaker.serverless.ServerlessInferenceConfig",")",":","Specifies","configuration","related","to","serverless","endpoint",".","Instance","type","is","not","provided","in","serverless","inference",".","So","this","is","used","to","find","image","URIs",".","inference_tool","(","str",")",":","the","tool","that","will","be","used","to","aid","in","the","inference",".","Valid","values",":","``","neuron",",","neuronx",",","None","''","(","default",":","None",")",".","accept_eula","(","bool",")",":","For","models","that","require","a","Model","Access","Config",",","specify","True","or","False","to","indicate","whether","model","terms","of","use","have","been","accepted",".","The","`","accept_eula","`","value","must","be","explicitly","defined","as","`","True","`","in","order","to","accept","the","end-user","license","agreement","(","EULA",")","that","some","models","require",".","(","Default",":","None",")",".","Returns",":","dict","[","str",",","str","]",":","A","container","definition","object","usable","with","the","CreateModel","API","."]
code: def prepare_container_def(
      self,
      instance_type=None,
      accelerator_type=None,
      serverless_inference_config=None,
      inference_tool=None,
      accept_eula=None,
  ):
      """A container definition with framework configuration set in model environment variables.
  
      Args:
          instance_type (str): The EC2 instance type to deploy this Model to.
              For example, 'ml.p2.xlarge'.
          accelerator_type (str): The Elastic Inference accelerator type to
              deploy to the instance for loading and making inferences to the
              model.
          serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig):
              Specifies configuration related to serverless endpoint. Instance type is
              not provided in serverless inference. So this is used to find image URIs.
          inference_tool (str): the tool that will be used to aid in the inference.
              Valid values: "neuron, neuronx, None" (default: None).
          accept_eula (bool): For models that require a Model Access Config, specify True or
              False to indicate whether model terms of use have been accepted.
              The `accept_eula` value must be explicitly defined as `True` in order to
              accept the end-user license agreement (EULA) that some
              models require. (Default: None).
  
      Returns:
          dict[str, str]: A container definition object usable with the
          CreateModel API.
      """
      deploy_image = self.image_uri
      if not deploy_image:
          if (
              instance_type is None
              and serverless_inference_config is None
          ):
              raise ValueError(
                  "Must supply either an instance type (for choosing CPU vs GPU) or an image URI."
              )
  
          region_name = self.sagemaker_session.boto_session.region_name
          deploy_image = self.serving_image_uri(
              region_name,
              instance_type,
              accelerator_type=accelerator_type,
              serverless_inference_config=serverless_inference_config,
              inference_tool=inference_tool,
          )
  
      deploy_key_prefix = model_code_key_prefix(
          self.key_prefix, self.name, deploy_image
      )
      self._upload_code(deploy_key_prefix, repack=True)
      deploy_env = dict(self.env)
      deploy_env.update(self._script_mode_env_vars())
  
      if self.model_server_workers:
          deploy_env[
              MODEL_SERVER_WORKERS_PARAM_NAME.upper()
          ] = to_string(self.model_server_workers)
      return sagemaker.container_def(
          deploy_image,
          self.repacked_model_data or self.model_data,
          deploy_env,
          accept_eula=accept_eula,
      )
  
imports: from __future__ import absolute_import
  import logging
  from typing import Optional, Union, List, Dict
  import sagemaker
  from sagemaker import image_uris, ModelMetrics
  from sagemaker.deserializers import JSONDeserializer
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.fw_utils import model_code_key_prefix, validate_version_or_image_args
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.model import FrameworkModel, MODEL_SERVER_WORKERS_PARAM_NAME
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import JSONSerializer
  from sagemaker.session import Session
  from sagemaker.utils import to_string, format_tags
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 4 for calling the HuggingFaceModel obj's underlying member method code with example usage: obj.prepare_container_def(instance_type, accelerator_type, serverless_inference_config, inference_tool, accept_eula) and returns: sagemaker