code: def convert(
      framework: str,
      model: str,
      output: Path,
      opset: int,
      tokenizer: Optional[str] = None,
      use_external_format: bool = False,
      pipeline_name: str = "feature-extraction",
      **model_kwargs,
  ):
      """
      Convert the pipeline object to the ONNX Intermediate Representation (IR) format
  
      Args:
          framework: The framework the pipeline is backed by ("pt" or "tf")
          model: The name of the model to load for the pipeline
          output: The path where the ONNX graph will be stored
          opset: The actual version of the ONNX operator set to use
          tokenizer: The name of the model to load for the pipeline, default to the model's name if not provided
          use_external_format:
              Split the model definition from its parameters to allow model bigger than 2GB (PyTorch only)
          pipeline_name: The kind of pipeline to instantiate (ner, question-answering, etc.)
          model_kwargs: Keyword arguments to be forwarded to the model constructor
  
      Returns:
  
      """
      warnings.warn(
          "The `transformers.convert_graph_to_onnx` package is deprecated and will be removed in version 5 of"
          " Transformers",
          FutureWarning,
      )
      print(f"ONNX opset version set to: {opset}")
  
      # Load the pipeline
      nlp = load_graph_from_args(
          pipeline_name, framework, model, tokenizer, **model_kwargs
      )
  
      if not output.parent.exists():
          print(f"Creating folder {output.parent}")
          makedirs(output.parent.as_posix())
      elif len(listdir(output.parent.as_posix())) > 0:
          raise Exception(
              f"Folder {output.parent.as_posix()} is not empty, aborting conversion"
          )
  
      # Export the graph
      if framework == "pt":
          convert_pytorch(nlp, opset, output, use_external_format)
      else:
          convert_tensorflow(nlp, opset, output)
  
imports: import warnings
  from argparse import ArgumentParser
  from os import listdir, makedirs
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple
  from packaging.version import Version, parse
  from transformers.pipelines import Pipeline, pipeline
  from transformers.tokenization_utils import BatchEncoding
  from transformers.utils import ModelOutput, is_tf_available, is_torch_available
label_desc: Use image node_id 8 for calling a global function with example usage: convert(framework, model, output, opset, tokenizer, use_external_format, pipeline_name) without return types