code: def test_huggingface_inference_inference_component_based_endpoint(
      sagemaker_session,
      gpu_pytorch_instance_type,
      huggingface_inference_latest_version,
      huggingface_inference_pytorch_latest_version,
      huggingface_pytorch_latest_inference_py_version,
  ):
      env = {
          "HF_MODEL_ID": "philschmid/tiny-distilbert-classification",
          "HF_TASK": "text-classification",
      }
      endpoint_name = unique_name_from_base("test-hf-inference")
  
      model = HuggingFaceModel(
          sagemaker_session=sagemaker_session,
          role="SageMakerRole",
          env=env,
          py_version=huggingface_pytorch_latest_inference_py_version,
          transformers_version=huggingface_inference_latest_version,
          pytorch_version=huggingface_inference_pytorch_latest_version,
      )
      predictor = model.deploy(
          instance_type=gpu_pytorch_instance_type,
          initial_instance_count=1,
          endpoint_name=endpoint_name,
          endpoint_type=EndpointType.INFERENCE_COMPONENT_BASED,
          resources=ResourceRequirements(
              requests={
                  "num_accelerators": 1,  # NumberOfCpuCoresRequired
                  "memory": 8192,  # MinMemoryRequiredInMb (required)
                  "copies": 1,
              },
              limits={},
          ),
      )
  
      data = {
          "inputs": "Camera - You are awarded a SiPix Digital Camera!"
          "call 09061221066 fromm landline. Delivery within 28 days."
      }
  
      output = predictor.predict(data)
      assert "score" in output[0]
  
      # delete predictor
      predictor.delete_predictor(wait=True)
  
      # delete endpoint
      predictor.delete_endpoint()
  
file_path: sagemaker-python-sdk/tests/integ/test_huggingface.py
imports: from __future__ import absolute_import
  import os
  import pytest
  import tests.integ
  from sagemaker.huggingface import HuggingFace, HuggingFaceProcessor
  from sagemaker.huggingface.model import HuggingFaceModel, HuggingFacePredictor
  from sagemaker.utils import unique_name_from_base
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
  from sagemaker.enums import EndpointType
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 5 for calling a global function with example usage: test_huggingface_inference_inference_component_based_endpoint(sagemaker_session, gpu_pytorch_instance_type, huggingface_inference_latest_version, huggingface_inference_pytorch_latest_version, huggingface_pytorch_latest_inference_py_version) without return types