class_docstr: Data collator that will dynamically pad the inputs received.
  Args:
      processor ([`Wav2Vec2Processor`])
          The processor used for processing the data.
      decoder_start_token_id (`int`)
          The begin-of-sentence of the decoder.
class_docstr_tok: ["Data","collator","that","will","dynamically","pad","the","inputs","received",".","Args",":","processor","(","[","`","Wav2Vec2Processor","`","]",")","The","processor","used","for","processing","the","data",".","decoder_start_token_id","(","`","int","`",")","The","begin-of-sentence","of","the","decoder","."]
code: def __call__(
      self, features: List[Dict[str, Union[List[int], torch.Tensor]]]
  ) -> Dict[str, torch.Tensor]:
      # split inputs and labels since they have to be of different lengths and need
      # different padding methods
      input_features = [
          {"input_values": feature["input_values"]}
          for feature in features
      ]
      label_features = [
          {"input_ids": feature["labels"]} for feature in features
      ]
  
      batch = self.processor.feature_extractor.pad(
          input_features, return_tensors="pt"
      )
  
      labels_batch = self.processor.tokenizer.pad(
          label_features, return_tensors="pt"
      )
  
      # replace padding with -100 to ignore loss correctly
      labels = labels_batch["input_ids"].masked_fill(
          labels_batch.attention_mask.ne(1), -100
      )
  
      # if bos token is appended in previous tokenization step,
      # cut bos token here as it's append later anyways
      if (
          (labels[:, 0] == self.decoder_start_token_id)
          .all()
          .cpu()
          .item()
      ):
          labels = labels[:, 1:]
  
      batch["labels"] = labels
  
      return batch
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py
imports: import logging
  import os
  import sys
  from dataclasses import dataclass, field
  from typing import Any, Dict, List, Optional, Union
  import datasets
  import torch
  from datasets import DatasetDict, load_dataset
  import evaluate
  import transformers
  from transformers import AutoConfig, AutoFeatureExtractor, AutoModelForSpeechSeq2Seq, AutoProcessor, AutoTokenizer, HfArgumentParser, Seq2SeqTrainer, Seq2SeqTrainingArguments, set_seed
  from transformers.trainer_utils import get_last_checkpoint, is_main_process
  from transformers.utils import check_min_version, send_example_telemetry
  from transformers.utils.versions import require_version
label_desc: Use image node_id 1 for calling the DataCollatorSpeechSeq2SeqWithPadding obj's underlying member method code with example usage: obj.__call__(features) and returns: batch