docstr: Returns the right inputs for the model, based on its signature.
docstr_tok: ["Returns","the","right","inputs","for","the","model",",","based","on","its","signature","."]
code: def get_inputs(self, pt_model, tf_dummy_inputs, config):
      """
      Returns the right inputs for the model, based on its signature.
      """
  
      def _get_audio_input():
          ds = load_dataset(
              "hf-internal-testing/librispeech_asr_dummy",
              "clean",
              split="validation",
          )
          speech_samples = ds.sort("id").select(range(2))[:2]["audio"]
          raw_samples = [x["array"] for x in speech_samples]
          return raw_samples
  
      model_config_class = type(pt_model.config)
      if model_config_class in PROCESSOR_MAPPING:
          processor = AutoProcessor.from_pretrained(self._local_dir)
          if (
              model_config_class in TOKENIZER_MAPPING
              and processor.tokenizer.pad_token is None
          ):
              processor.tokenizer.pad_token = (
                  processor.tokenizer.eos_token
              )
      elif model_config_class in IMAGE_PROCESSOR_MAPPING:
          processor = AutoImageProcessor.from_pretrained(
              self._local_dir
          )
      elif model_config_class in FEATURE_EXTRACTOR_MAPPING:
          processor = AutoFeatureExtractor.from_pretrained(
              self._local_dir
          )
      elif model_config_class in TOKENIZER_MAPPING:
          processor = AutoTokenizer.from_pretrained(self._local_dir)
          if processor.pad_token is None:
              processor.pad_token = processor.eos_token
      else:
          raise ValueError(
              f"Unknown data processing type (model config type: {model_config_class})"
          )
  
      model_forward_signature = set(
          inspect.signature(pt_model.forward).parameters.keys()
      )
      processor_inputs = {}
      if "input_ids" in model_forward_signature:
          processor_inputs.update(
              {
                  "text": [
                      "Hi there!",
                      "I am a batch with more than one row and different input lengths.",
                  ],
                  "padding": True,
                  "truncation": True,
              }
          )
      if "pixel_values" in model_forward_signature:
          sample_images = load_dataset(
              "cifar10", "plain_text", split="test"
          )[:2]["img"]
          processor_inputs.update({"images": sample_images})
      if "input_features" in model_forward_signature:
          feature_extractor_signature = inspect.signature(
              processor.feature_extractor
          ).parameters
          # Pad to the largest input length by default but take feature extractor default
          # padding value if it exists e.g. "max_length" and is not False or None
          if "padding" in feature_extractor_signature:
              default_strategy = feature_extractor_signature[
                  "padding"
              ].default
              if (
                  default_strategy is not False
                  and default_strategy is not None
              ):
                  padding_strategy = default_strategy
              else:
                  padding_strategy = True
          else:
              padding_strategy = True
          processor_inputs.update(
              {"audio": _get_audio_input(), "padding": padding_strategy}
          )
      if (
          "input_values" in model_forward_signature
      ):  # Wav2Vec2 audio input
          processor_inputs.update(
              {"audio": _get_audio_input(), "padding": True}
          )
      pt_input = processor(**processor_inputs, return_tensors="pt")
      tf_input = processor(**processor_inputs, return_tensors="tf")
  
      # Extra input requirements, in addition to the input modality
      if (
          config.is_encoder_decoder
          or (
              hasattr(pt_model, "encoder")
              and hasattr(pt_model, "decoder")
          )
          or "decoder_input_ids" in tf_dummy_inputs
      ):
          decoder_input_ids = np.asarray([[1], [1]], dtype=int) * (
              pt_model.config.decoder_start_token_id or 0
          )
          pt_input.update(
              {"decoder_input_ids": torch.tensor(decoder_input_ids)}
          )
          tf_input.update(
              {
                  "decoder_input_ids": tf.convert_to_tensor(
                      decoder_input_ids
                  )
              }
          )
  
      return pt_input, tf_input
  
file_path: transformers/src/transformers/commands/pt_to_tf.py
imports: import inspect
  import os
  from argparse import ArgumentParser, Namespace
  from importlib import import_module
  import huggingface_hub
  import numpy
  from packaging import version
  from ..None import FEATURE_EXTRACTOR_MAPPING, IMAGE_PROCESSOR_MAPPING, PROCESSOR_MAPPING, TOKENIZER_MAPPING, AutoConfig, AutoFeatureExtractor, AutoImageProcessor, AutoProcessor, AutoTokenizer, is_datasets_available, is_tf_available, is_torch_available
  from ..utils import TF2_WEIGHTS_INDEX_NAME, TF2_WEIGHTS_NAME, logging
  from .None import BaseTransformersCLICommand
label_desc: Use image node_id 4 for calling the PTtoTFCommand obj's underlying member method code with example usage: obj.get_inputs(pt_model, tf_dummy_inputs, config) and returns: pt_input,  tf_input, raw_samples