class_docstr: Data collator used for T5 span-masked language modeling.
  It is made sure that after masking the inputs are of length `data_args.max_seq_length` and targets are also of fixed length.
  For more information on how T5 span-masked language modeling works, one can take a look
  at the `official paper <https://arxiv.org/pdf/1910.10683.pdf>`__
  or the `official code for preprocessing <https://github.com/google-research/text-to-text-transfer-transformer/blob/master/t5/data/preprocessors.py>`__ .
  
  Args:
      tokenizer (:class:`~transformers.PreTrainedTokenizer` or :class:`~transformers.PreTrainedTokenizerFast`):
          The tokenizer used for encoding the data.
      noise_density (:obj:`float`):
          The probability with which to (randomly) mask tokens in the input.
      mean_noise_span_length (:obj:`float`):
          The average span length of the masked tokens.
      input_length (:obj:`int`):
          The expected input length after masking.
      target_length (:obj:`int`):
          The expected target length after masking.
      pad_token_id: (:obj:`int`):
          The pad token id of the model
      decoder_start_token_id: (:obj:`int):
          The decoder start token id of the model
docstr: Puts sentinel mask on `input_ids` and fuse consecutive mask tokens into a single mask token by deleting.
  This will reduce the sequence length from `expanded_inputs_length` to `input_length`.
docstr_tok: ["Puts","sentinel","mask","on","`","input_ids","`","and","fuse","consecutive","mask","tokens","into","a","single","mask","token","by","deleting",".","This","will","reduce","the","sequence","length","from","`","expanded_inputs_length","`","to","`","input_length","`","."]
code: def filter_input_ids(self, input_ids, sentinel_ids):
      """
      Puts sentinel mask on `input_ids` and fuse consecutive mask tokens into a single mask token by deleting.
      This will reduce the sequence length from `expanded_inputs_length` to `input_length`.
      """
      batch_size = input_ids.shape[0]
  
      input_ids_full = np.where(
          sentinel_ids != 0, sentinel_ids, input_ids
      )
      # input_ids tokens and sentinel tokens are >= 0, tokens < 0 are
      # masked tokens coming after sentinel tokens and should be removed
      input_ids = input_ids_full[input_ids_full >= 0].reshape(
          (batch_size, -1)
      )
      input_ids = np.concatenate(
          [
              input_ids,
              np.full(
                  (batch_size, 1),
                  self.tokenizer.eos_token_id,
                  dtype=np.int32,
              ),
          ],
          axis=-1,
      )
      return input_ids
  
imports: import json
  import logging
  import math
  import os
  import sys
  import time
  from dataclasses import asdict, dataclass, field
  from enum import Enum
  from itertools import chain
  from pathlib import Path
  from typing import Dict, List, Optional
  import numpy
  from datasets import load_dataset
  from tqdm import tqdm
  import flax
  import jax
  import jax.numpy
  import optax
  from flax import jax_utils, traverse_util
  from flax.jax_utils import pad_shard_unpad
  from flax.training import train_state
  from flax.training.common_utils import get_metrics, onehot, shard
  from huggingface_hub import Repository
  from transformers import CONFIG_MAPPING, FLAX_MODEL_FOR_MASKED_LM_MAPPING, AutoTokenizer, BatchEncoding, FlaxT5ForConditionalGeneration, HfArgumentParser, PreTrainedTokenizerBase, T5Config, is_tensorboard_available, set_seed
  from transformers.models.t5.modeling_flax_t5 import shift_tokens_right
  from transformers.utils import get_full_repo_name, send_example_telemetry
label_desc: Use image node_id 3 for calling the FlaxDataCollatorForT5MLM obj's underlying member method code with example usage: obj.filter_input_ids(input_ids, sentinel_ids) and returns: input_ids