code: def test_custom_pipeline(
      pair_classification_pipeline: PairClassificationPipeline,
  ):
      """
      Test saving and loading a custom pipeline from scratch. This is not covered by the framework tests
      because it does not load a custom pipeline without first adding to the transformers SUPPORTED_TASKS.
      """
      from bentoml._internal.frameworks.transformers import (
          PIPELINE_PICKLE_NAME,
      )
  
      from .models.transformers import PairClassificationPipeline
  
      bento_model = bentoml.transformers.save_model(
          "my_classification_model",
          pipeline=pair_classification_pipeline,
          task_name=TASK_NAME,
          task_definition={
              "impl": PairClassificationPipeline,
              "pt": AutoModelForSequenceClassification,
          },
      )
  
      assert os.path.exists(bento_model.path_of(PIPELINE_PICKLE_NAME))
      assert bento_model.tag.name == "my_classification_model"
  
      loaded_pipeline = bentoml.transformers.load_model(
          "my_classification_model:latest"
      )
      assert pair_classification_pipeline(
          "I hate you", second_text="I love you"
      ) == loaded_pipeline("I hate you", second_text="I love you")
  
      # Test runners
      bento_model = bentoml.transformers.get("my_classification_model")
      runner = bento_model.to_runner()
      runner.init_local()
  
      assert runner.run(
          "I hate you", second_text="I love you"
      ) == pair_classification_pipeline(
          "I hate you", second_text="I love you"
      )
  
      runner.destroy()
  
      runner = bento_model.to_runner()
      runner.init_local()
      assert runner.run(
          "I hate you", second_text="I love you"
      ) == pair_classification_pipeline(
          "I hate you", second_text="I love you"
      )
  
      runner.destroy()
  
imports: from __future__ import annotations
  import logging
  import os
  import typing
  import pytest
  import transformers
  from transformers.models.auto.modeling_auto import AutoModelForAudioClassification
  from transformers.models.auto.modeling_auto import AutoModelForCausalLM
  from transformers.models.auto.modeling_auto import AutoModelForSequenceClassification
  from transformers.pipelines import check_task
  from transformers.pipelines import pipeline
  from transformers.pipelines.audio_classification import AudioClassificationPipeline
  from transformers.trainer_utils import set_seed
  import bentoml
  from bentoml.exceptions import BentoMLException
  from bentoml.transformers import ModelOptions
label_desc: Use image node_id 11 for calling a global function with example usage: test_custom_pipeline(pair_classification_pipeline) without return types