class_docstr: Make prediction requests to an Amazon SageMaker endpoint.
class_docstr_tok: ["Make","prediction","requests","to","an","Amazon","SageMaker","endpoint","."]
docstr: Updates the predictor.
  
  You can deploy a new Model specification or apply new configurations. The SDK
  applies your updates by updating the inference component that's associated with
  the model.
  
  Args:
      model_name (Optional[str]): The model name to use to update the
          predictor. (Default: None).
      image_uri (Optional[str]): A Docker image URI. (Default: None).
      model_data (Optional[Union[str, dict]]): Location
          of SageMaker model data. (Default: None).
      env (Optional[dict[str, str]]): Environment variables
          to run with ``image_uri`` when hosted in SageMaker. (Default: None).
      model_data_download_timeout (Optional[int]): The timeout value, in seconds, to download
          and extract model data from Amazon S3 to the individual inference instance
          associated with this production variant. (Default: None).
      container_startup_health_check_timeout (Optional[int]): The timeout value, in seconds,
          for your inference container to pass health check by SageMaker Hosting. For more
          information about health check see:
          https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests
          (Default: None).
      resources (Optional[ResourceRequirements]): The compute resource requirements
          for a model to be deployed to an endpoint.
          Only EndpointType.INFERENCE_COMPONENT_BASED supports this feature.
          (Default: None).
docstr_tok: ["Updates","the","predictor",".","You","can","deploy","a","new","Model","specification","or","apply","new","configurations",".","The","SDK","applies","your","updates","by","updating","the","inference","component","that","'s","associated","with","the","model",".","Args",":","model_name","(","Optional","[","str","]",")",":","The","model","name","to","use","to","update","the","predictor",".","(","Default",":","None",")",".","image_uri","(","Optional","[","str","]",")",":","A","Docker","image","URI",".","(","Default",":","None",")",".","model_data","(","Optional","[","Union","[","str",",","dict","]","]",")",":","Location","of","SageMaker","model","data",".","(","Default",":","None",")",".","env","(","Optional","[","dict","[","str",",","str","]","]",")",":","Environment","variables","to","run","with","``","image_uri","``","when","hosted","in","SageMaker",".","(","Default",":","None",")",".","model_data_download_timeout","(","Optional","[","int","]",")",":","The","timeout","value",",","in","seconds",",","to","download","and","extract","model","data","from","Amazon","S3","to","the","individual","inference","instance","associated","with","this","production","variant",".","(","Default",":","None",")",".","container_startup_health_check_timeout","(","Optional","[","int","]",")",":","The","timeout","value",",","in","seconds",",","for","your","inference","container","to","pass","health","check","by","SageMaker","Hosting",".","For","more","information","about","health","check","see",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/your-algorithms-inference-code.html","#","your-algorithms-inference-algo-ping-requests","(","Default",":","None",")",".","resources","(","Optional","[","ResourceRequirements","]",")",":","The","compute","resource","requirements","for","a","model","to","be","deployed","to","an","endpoint",".","Only","EndpointType.INFERENCE_COMPONENT_BASED","supports","this","feature",".","(","Default",":","None",")","."]
code: def update_predictor(
      self,
      model_name: Optional[str] = None,
      image_uri: Optional[str] = None,
      model_data: Optional[Union[str, dict]] = None,
      env: Optional[Dict[str, str]] = None,
      model_data_download_timeout: Optional[int] = None,
      container_startup_health_check_timeout: Optional[int] = None,
      resources: Optional[ResourceRequirements] = None,
  ):
      """Updates the predictor.
  
      You can deploy a new Model specification or apply new configurations. The SDK
      applies your updates by updating the inference component that's associated with
      the model.
  
      Args:
          model_name (Optional[str]): The model name to use to update the
              predictor. (Default: None).
          image_uri (Optional[str]): A Docker image URI. (Default: None).
          model_data (Optional[Union[str, dict]]): Location
              of SageMaker model data. (Default: None).
          env (Optional[dict[str, str]]): Environment variables
              to run with ``image_uri`` when hosted in SageMaker. (Default: None).
          model_data_download_timeout (Optional[int]): The timeout value, in seconds, to download
              and extract model data from Amazon S3 to the individual inference instance
              associated with this production variant. (Default: None).
          container_startup_health_check_timeout (Optional[int]): The timeout value, in seconds,
              for your inference container to pass health check by SageMaker Hosting. For more
              information about health check see:
              https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests
              (Default: None).
          resources (Optional[ResourceRequirements]): The compute resource requirements
              for a model to be deployed to an endpoint.
              Only EndpointType.INFERENCE_COMPONENT_BASED supports this feature.
              (Default: None).
      """
      if self.component_name is None:
          raise ValueError(
              "No inference component exists for the specified model. "
              "Ensure that you deployed the inference component, and try again."
          )
      # [TODO]: Move to a module
      request = {
          "inference_component_name": self.component_name,
          "specification": {
              "Container": {},
              "StartupParameters": {},
          },
      }
  
      if resources:
          request["specification"][
              "ComputeResourceRequirements"
          ] = resources.get_compute_resource_requirements()
  
      # ModelName XOR Container
      if model_name:
          request["specification"]["ModelName"] = model_name
      else:
          if image_uri:
              request["specification"]["Container"]["Image"] = image_uri
  
          if env:
              request["specification"]["Container"]["Environment"] = env
  
          if model_data:
              request["specification"]["Container"][
                  "ArtifactUrl"
              ] = model_data
  
      if resources.copy_count:
          request["runtime_config"] = {
              "CopyCount": resources.copy_count
          }
  
      if model_data_download_timeout:
          request["specification"]["StartupParameters"][
              "ModelDataDownloadTimeoutInSeconds"
          ] = model_data_download_timeout
  
      if container_startup_health_check_timeout:
          request["specification"]["StartupParameters"][
              "ContainerStartupHealthCheckTimeoutInSeconds"
          ] = container_startup_health_check_timeout
  
      if "specification" in request:
          empty_keys = []
          for key, value in request["specification"].items():
              if not value:
                  empty_keys.append(key)
          for key in empty_keys:
              del request["specification"][key]
  
      self.sagemaker_session.update_inference_component(**request)
  
imports: from __future__ import print_function, absolute_import
  import abc
  import datetime
  from typing import Any, Dict, Optional, Tuple, Union
  import logging
  from sagemaker.enums import EndpointType
  from sagemaker.deprecations import deprecated_class, deprecated_deserialize, deprecated_serialize, removed_kwargs, renamed_kwargs, renamed_warning
  from sagemaker.deserializers import BytesDeserializer, CSVDeserializer, JSONDeserializer, NumpyDeserializer, StreamDeserializer, StringDeserializer
  from sagemaker.jumpstart.payload_utils import PayloadSerializer
  from sagemaker.jumpstart.types import JumpStartSerializablePayload
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
  from sagemaker.model_monitor import DataCaptureConfig, DefaultModelMonitor, ModelBiasMonitor, ModelExplainabilityMonitor, ModelMonitor, ModelQualityMonitor
  from sagemaker.serializers import CSVSerializer, IdentitySerializer, JSONSerializer, NumpySerializer
  from sagemaker.session import production_variant, Session
  from sagemaker.utils import name_from_base, stringify_object, format_tags
  from sagemaker.model_monitor.model_monitoring import DEFAULT_REPOSITORY_NAME
  from sagemaker.lineage.context import EndpointContext
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 9 for calling the Predictor obj's underlying member method code with example usage: obj.update_predictor(model_name, image_uri, model_data, env, model_data_download_timeout, container_startup_health_check_timeout, resources) without return types