class_docstr: A class containing all functions for auto-regressive text generation, to be used as a mixin in
  [`FlaxPreTrainedModel`].
  
  The class exposes [`~generation_flax_utils.FlaxGenerationMixin.generate`], which can be used for:
          - *greedy decoding* by calling [`~generation_flax_utils.FlaxGenerationMixin._greedy_search`] if
            `num_beams=1` and `do_sample=False`.
          - *multinomial sampling* by calling [`~generation_flax_utils.FlaxGenerationMixin._sample`] if `num_beams=1`
            and `do_sample=True`.
          - *beam-search decoding* by calling [`~generation_utils.FlaxGenerationMixin._beam_search`] if `num_beams>1`
            and `do_sample=False`.
class_docstr_tok: ["A","class","containing","all","functions","for","auto-regressive","text","generation",",","to","be","used","as","a","mixin","in","[","`","FlaxPreTrainedModel","`","]",".","The","class","exposes","[","`","~generation_flax_utils.FlaxGenerationMixin.generate","`","]",",","which","can","be","used","for",":","-","*","greedy","decoding","*","by","calling","[","`","~generation_flax_utils.FlaxGenerationMixin._greedy_search","`","]","if","`","num_beams=1","`","and","`","do_sample=False","`",".","-","*","multinomial","sampling","*","by","calling","[","`","~generation_flax_utils.FlaxGenerationMixin._sample","`","]","if","`","num_beams=1","`","and","`","do_sample=True","`",".","-","*","beam-search","decoding","*","by","calling","[","`","~generation_utils.FlaxGenerationMixin._beam_search","`","]","if","`","num_beams",">","1","`","and","`","do_sample=False","`","."]
docstr: This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsProcessor`]
  instances used to modify the scores of the language model head.
docstr_tok: ["This","class","returns","a","[","`","FlaxLogitsProcessorList","`","]","list","object","that","contains","all","relevant","[","`","FlaxLogitsProcessor","`","]","instances","used","to","modify","the","scores","of","the","language","model","head","."]
code: def _get_logits_processor(
      self,
      no_repeat_ngram_size: int,
      min_length: int,
      max_length: int,
      eos_token_id: int,
      forced_bos_token_id: int,
      forced_eos_token_id: int,
  ) -> FlaxLogitsProcessorList:
      """
      This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsProcessor`]
      instances used to modify the scores of the language model head.
      """
      processors = FlaxLogitsProcessorList()
  
      # init warp parameters
      no_repeat_ngram_size = (
          no_repeat_ngram_size
          if no_repeat_ngram_size is not None
          else self.config.no_repeat_ngram_size
      )
      eos_token_id = (
          eos_token_id
          if eos_token_id is not None
          else self.config.eos_token_id
      )
      forced_bos_token_id = (
          forced_bos_token_id
          if forced_bos_token_id is not None
          else self.config.forced_bos_token_id
      )
      forced_eos_token_id = (
          forced_eos_token_id
          if forced_eos_token_id is not None
          else self.config.forced_eos_token_id
      )
  
      # the following idea is largely copied from this PR: https://github.com/huggingface/transformers/pull/5420/files
      # all samplers can be found in `generation_utils_samplers.py`
      if (
          min_length is not None
          and eos_token_id is not None
          and min_length > -1
      ):
          processors.append(
              FlaxMinLengthLogitsProcessor(min_length, eos_token_id)
          )
      if forced_bos_token_id is not None:
          processors.append(
              FlaxForcedBOSTokenLogitsProcessor(forced_bos_token_id)
          )
      if forced_eos_token_id is not None:
          processors.append(
              FlaxForcedEOSTokenLogitsProcessor(
                  max_length, forced_eos_token_id
              )
          )
      return processors
  
imports: import inspect
  import warnings
  from functools import partial
  from typing import Any, Dict, Optional
  import numpy
  import flax
  import jax
  import jax.numpy
  from jax import lax
  from .generation_flax_logits_process import FlaxForcedBOSTokenLogitsProcessor, FlaxForcedEOSTokenLogitsProcessor, FlaxLogitsProcessorList, FlaxMinLengthLogitsProcessor, FlaxTemperatureLogitsWarper, FlaxTopKLogitsWarper, FlaxTopPLogitsWarper
  from .models.auto import FLAX_MODEL_FOR_CAUSAL_LM_MAPPING, FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING
  from .utils import ModelOutput, logging
label_desc: Use image node_id 9 for calling the FlaxGenerationMixin obj's underlying member method code with example usage: obj._get_logits_processor(no_repeat_ngram_size, min_length, max_length, eos_token_id, forced_bos_token_id, forced_eos_token_id) and returns: processors