class_docstr: Base class for ONNX exportable model describing metadata on how to export the model through the ONNX format.
docstr: Generate inputs to provide to the ONNX exporter for the specific framework
  
  Args:
      preprocessor: ([`PreTrainedTokenizerBase`], [`FeatureExtractionMixin`], or [`ImageProcessingMixin`]):
          The preprocessor associated with this model configuration.
      batch_size (`int`, *optional*, defaults to -1):
          The batch size to export the model for (-1 means dynamic axis).
      num_choices (`int`, *optional*, defaults to -1):
          The number of candidate answers provided for multiple choice task (-1 means dynamic axis).
      seq_length (`int`, *optional*, defaults to -1):
          The sequence length to export the model for (-1 means dynamic axis).
      is_pair (`bool`, *optional*, defaults to `False`):
          Indicate if the input is a pair (sentence 1, sentence 2)
      framework (`TensorType`, *optional*, defaults to `None`):
          The framework (PyTorch or TensorFlow) that the tokenizer will generate tensors for.
      num_channels (`int`, *optional*, defaults to 3):
          The number of channels of the generated images.
      image_width (`int`, *optional*, defaults to 40):
          The width of the generated images.
      image_height (`int`, *optional*, defaults to 40):
          The height of the generated images.
      sampling_rate (`int`, *optional* defaults to 22050)
          The sampling rate for audio data generation.
      time_duration (`float`, *optional* defaults to 5.0)
          Total seconds of sampling for audio data generation.
      frequency (`int`, *optional* defaults to 220)
          The desired natural frequency of generated audio.
  
  Returns:
      Mapping[str, Tensor] holding the kwargs to provide to the model's forward function
docstr_tok: ["Generate","inputs","to","provide","to","the","ONNX","exporter","for","the","specific","framework","Args",":","preprocessor",":","(","[","`","PreTrainedTokenizerBase","`","]",",","[","`","FeatureExtractionMixin","`","]",",","or","[","`","ImageProcessingMixin","`","]",")",":","The","preprocessor","associated","with","this","model","configuration",".","batch_size","(","`","int","`",",","*","optional","*",",","defaults","to","-1",")",":","The","batch","size","to","export","the","model","for","(","-1","means","dynamic","axis",")",".","num_choices","(","`","int","`",",","*","optional","*",",","defaults","to","-1",")",":","The","number","of","candidate","answers","provided","for","multiple","choice","task","(","-1","means","dynamic","axis",")",".","seq_length","(","`","int","`",",","*","optional","*",",","defaults","to","-1",")",":","The","sequence","length","to","export","the","model","for","(","-1","means","dynamic","axis",")",".","is_pair","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Indicate","if","the","input","is","a","pair","(","sentence","1",",","sentence","2",")","framework","(","`","TensorType","`",",","*","optional","*",",","defaults","to","`","None","`",")",":","The","framework","(","PyTorch","or","TensorFlow",")","that","the","tokenizer","will","generate","tensors","for",".","num_channels","(","`","int","`",",","*","optional","*",",","defaults","to","3",")",":","The","number","of","channels","of","the","generated","images",".","image_width","(","`","int","`",",","*","optional","*",",","defaults","to","40",")",":","The","width","of","the","generated","images",".","image_height","(","`","int","`",",","*","optional","*",",","defaults","to","40",")",":","The","height","of","the","generated","images",".","sampling_rate","(","`","int","`",",","*","optional","*","defaults","to","22050",")","The","sampling","rate","for","audio","data","generation",".","time_duration","(","`","float","`",",","*","optional","*","defaults","to","5.0",")","Total","seconds","of","sampling","for","audio","data","generation",".","frequency","(","`","int","`",",","*","optional","*","defaults","to","220",")","The","desired","natural","frequency","of","generated","audio",".","Returns",":","Mapping","[","str",",","Tensor","]","holding","the","kwargs","to","provide","to","the","model","'s","forward","function"]
code: def generate_dummy_inputs(
      self,
      preprocessor: Union[
          "PreTrainedTokenizerBase",
          "FeatureExtractionMixin",
          "ImageProcessingMixin",
      ],
      batch_size: int = -1,
      seq_length: int = -1,
      num_choices: int = -1,
      is_pair: bool = False,
      framework: Optional[TensorType] = None,
      num_channels: int = 3,
      image_width: int = 40,
      image_height: int = 40,
      sampling_rate: int = 22050,
      time_duration: float = 5.0,
      frequency: int = 220,
      tokenizer: "PreTrainedTokenizerBase" = None,
  ) -> Mapping[str, Any]:
      """
      Generate inputs to provide to the ONNX exporter for the specific framework
  
      Args:
          preprocessor: ([`PreTrainedTokenizerBase`], [`FeatureExtractionMixin`], or [`ImageProcessingMixin`]):
              The preprocessor associated with this model configuration.
          batch_size (`int`, *optional*, defaults to -1):
              The batch size to export the model for (-1 means dynamic axis).
          num_choices (`int`, *optional*, defaults to -1):
              The number of candidate answers provided for multiple choice task (-1 means dynamic axis).
          seq_length (`int`, *optional*, defaults to -1):
              The sequence length to export the model for (-1 means dynamic axis).
          is_pair (`bool`, *optional*, defaults to `False`):
              Indicate if the input is a pair (sentence 1, sentence 2)
          framework (`TensorType`, *optional*, defaults to `None`):
              The framework (PyTorch or TensorFlow) that the tokenizer will generate tensors for.
          num_channels (`int`, *optional*, defaults to 3):
              The number of channels of the generated images.
          image_width (`int`, *optional*, defaults to 40):
              The width of the generated images.
          image_height (`int`, *optional*, defaults to 40):
              The height of the generated images.
          sampling_rate (`int`, *optional* defaults to 22050)
              The sampling rate for audio data generation.
          time_duration (`float`, *optional* defaults to 5.0)
              Total seconds of sampling for audio data generation.
          frequency (`int`, *optional* defaults to 220)
              The desired natural frequency of generated audio.
  
      Returns:
          Mapping[str, Tensor] holding the kwargs to provide to the model's forward function
      """
      from ..feature_extraction_utils import FeatureExtractionMixin
      from ..image_processing_utils import ImageProcessingMixin
      from ..tokenization_utils_base import PreTrainedTokenizerBase
  
      if (
          isinstance(preprocessor, PreTrainedTokenizerBase)
          and tokenizer is not None
      ):
          raise ValueError(
              "You cannot provide both a tokenizer and a preprocessor to generate dummy inputs."
          )
      if tokenizer is not None:
          warnings.warn(
              "The `tokenizer` argument is deprecated and will be removed in version 5 of Transformers. Use"
              " `preprocessor` instead.",
              FutureWarning,
          )
          logger.warning(
              "Overwriting the `preprocessor` argument with `tokenizer` to generate dummmy inputs."
          )
          preprocessor = tokenizer
      if isinstance(preprocessor, PreTrainedTokenizerBase):
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          batch_size = compute_effective_axis_dimension(
              batch_size,
              fixed_dimension=OnnxConfig.default_fixed_batch,
              num_token_to_add=0,
          )
          # If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
          token_to_add = preprocessor.num_special_tokens_to_add(is_pair)
          seq_length = compute_effective_axis_dimension(
              seq_length,
              fixed_dimension=OnnxConfig.default_fixed_sequence,
              num_token_to_add=token_to_add,
          )
          # Generate dummy inputs according to compute batch and sequence
          input_token = (
              preprocessor.unk_token
              if (
                  preprocessor.unk_token is not None
                  and len(preprocessor.unk_token) > 0
              )
              else "0"
          )
          dummy_input = [
              " ".join([input_token]) * seq_length
          ] * batch_size
          if self.task == "multiple-choice":
              # If dynamic axis (-1) we forward with a fixed dimension of 4 candidate answers to avoid optimizations
              # made by ONNX
              num_choices = compute_effective_axis_dimension(
                  num_choices,
                  fixed_dimension=OnnxConfig.default_fixed_num_choices,
                  num_token_to_add=0,
              )
              dummy_input = dummy_input * num_choices
              # The shape of the tokenized inputs values is [batch_size * num_choices, seq_length]
              tokenized_input = preprocessor(
                  dummy_input, text_pair=dummy_input
              )
              # Unflatten the tokenized inputs values expanding it to the shape [batch_size, num_choices, seq_length]
              for k, v in tokenized_input.items():
                  tokenized_input[k] = [
                      v[i : i + num_choices]
                      for i in range(0, len(v), num_choices)
                  ]
              return dict(
                  tokenized_input.convert_to_tensors(
                      tensor_type=framework
                  )
              )
          return dict(
              preprocessor(dummy_input, return_tensors=framework)
          )
      elif isinstance(preprocessor, ImageProcessingMixin):
          if preprocessor.model_input_names[0] != "pixel_values":
              raise ValueError(
                  f"The `preprocessor` is an image processor ({preprocessor.__class__.__name__}) and expects"
                  f' `model_input_names[0]` to be "pixel_values", but got {preprocessor.model_input_names[0]}'
              )
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          batch_size = compute_effective_axis_dimension(
              batch_size, fixed_dimension=OnnxConfig.default_fixed_batch
          )
          dummy_input = self._generate_dummy_images(
              batch_size, num_channels, image_height, image_width
          )
          return dict(
              preprocessor(images=dummy_input, return_tensors=framework)
          )
      elif (
          isinstance(preprocessor, FeatureExtractionMixin)
          and preprocessor.model_input_names[0] == "pixel_values"
      ):
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          batch_size = compute_effective_axis_dimension(
              batch_size, fixed_dimension=OnnxConfig.default_fixed_batch
          )
          dummy_input = self._generate_dummy_images(
              batch_size, num_channels, image_height, image_width
          )
          return dict(
              preprocessor(images=dummy_input, return_tensors=framework)
          )
      elif (
          isinstance(preprocessor, FeatureExtractionMixin)
          and preprocessor.model_input_names[0] == "input_features"
      ):
          # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
          batch_size = compute_effective_axis_dimension(
              batch_size, fixed_dimension=OnnxConfig.default_fixed_batch
          )
          dummy_input = self._generate_dummy_audio(
              batch_size, sampling_rate, time_duration, frequency
          )
          return dict(
              preprocessor(dummy_input, return_tensors=framework)
          )
      else:
          raise ValueError(
              "Unable to generate dummy inputs for the model. Please provide a tokenizer or a preprocessor."
          )
  
imports: import copy
  import dataclasses
  import warnings
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import numpy
  from packaging import version
  from ..utils import TensorType, is_torch_available, is_vision_available, logging
  from .utils import ParameterFormat, compute_effective_axis_dimension, compute_serialized_parameters_size
label_desc: Use image node_id 15 for calling the OnnxConfig obj's underlying member method code with example usage: obj.generate_dummy_inputs(preprocessor, batch_size, seq_length, num_choices, is_pair, framework, num_channels, image_width, image_height, sampling_rate, time_duration, frequency, tokenizer) and returns: dict, dict, dict, dict, dict