# transformers 5.24.1 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input

        Generates sequences of token ids.

        <Tip warning={true}>

        Most generation-controlling parameters are set in `generation_config` which, if not passed, will be set to the
        model's default generation configuration. You can override any `generation_config` by passing the corresponding
        parameters to generate(), e.g. `.generate(inputs, num_beams=4, do_sample=True)`.

        For an overview of generation strategies and code examples, check out the [following
        guide](./generation_strategies).

        </Tip>

        Parameters:
            input_ids (`torch.Tensor` of varying shape depending on the modality, *optional*):
                Indices of input sequence tokens in the vocabulary.

                Indices can be obtained using [`SeamlessM4TTokenizer`] or [`SeamlessM4TProcessor`]. See
                [`PreTrainedTokenizer.encode`] and [`PreTrainedTokenizer.__call__`] for details.

                [What are input IDs?](../glossary#input-ids)
            tgt_lang (`str`, *optional*):
                The language to use as target language for translation.
            generation_config (`~generation.GenerationConfig`, *optional*):
                The generation configuration to be used as base parametrization for the generation call. `**kwargs`
                passed to generate matching the attributes of `generation_config` will override them. If
                `generation_config` is not provided, the default will be used, which had the following loading
                priority: 1) from the `generation_config.json` model file, if it exists; 2) from the model
                configuration. Please note that unspecified parameters will inherit [`~generation.GenerationConfig`]'s
                default values, whose documentation should be checked to parameterize generation.
            logits_processor (`LogitsProcessorList`, *optional*):
                Custom logits processors that complement the default logits processors built from arguments and
                generation config. If a logit processor is passed that is already created with the arguments or a
                generation config an error is thrown. This feature is intended for advanced users.
            stopping_criteria (`StoppingCriteriaList`, *optional*):
                Custom stopping criteria that complement the default stopping criteria built from arguments and a
                generation config. If a stopping criteria is passed that is already created with the arguments or a
                generation config an error is thrown. This feature is intended for advanced users.
            prefix_allowed_tokens_fn (`Callable[[int, torch.Tensor], list[int]]`, *optional*):
                If provided, this function constraints the beam search to allowed tokens only at each step. If not
                provided no constraint is applied. This function takes 2 arguments: the batch ID `batch_id` and
                `input_ids`. It has to return a list with the allowed tokens for the next generation step conditioned
                on the batch ID `batch_id` and the previously generated tokens `inputs_ids`. This argument is useful
                for constrained generation conditioned on the prefix, as described in [Autoregressive Entity
                Retrieval](https://huggingface.co/papers/2010.00904).
            synced_gpus (`bool`, *optional*, defaults to `False`):
                Whether to continue running the while loop until max_length (needed to avoid deadlocking with
                `FullyShardedDataParallel` and DeepSpeed ZeRO Stage 3).
            kwargs (`dict[str, Any]`, *optional*):
                Ad hoc parametrization of `generate_config` and/or additional model-specific kwargs that will be
                forwarded to the `forward` function of the model.

        Return:
            [`~utils.ModelOutput`] or `torch.LongTensor`: A [`~utils.ModelOutput`] (if `return_dict_in_generate=True`
            or when `config.return_dict_in_generate=True`) or a `torch.Tensor`. The possible
            [`~utils.ModelOutput`] types are:
                - [`~generation.GenerateEncoderDecoderOutput`],
                - [`~generation.GenerateBeamEncoderDecoderOutput`]
        
=== parse google
short_description: 'Generates sequences of token ids.'
long_description: |
  <Tip warning={true}>
  
  Most generation-controlling parameters are set in `generation_config` which, if not passed, will be set to the
  model's default generation configuration. You can override any `generation_config` by passing the corresponding
  parameters to generate(), e.g. `.generate(inputs, num_beams=4, do_sample=True)`.
  
  For an overview of generation strategies and code examples, check out the [following
  guide](./generation_strategies).
  
  </Tip>
blank_after_short_description: True
blank_after_long_description: True
style: google
- DocstringParam
  description: |
    Indices of input sequence tokens in the vocabulary.
    
    Indices can be obtained using [`SeamlessM4TTokenizer`] or [`SeamlessM4TProcessor`]. See
    [`PreTrainedTokenizer.encode`] and [`PreTrainedTokenizer.__call__`] for details.
    
    [What are input IDs?](../glossary#input-ids)
  kind: param
  key: 'param'
  arg_name: 'input_ids'
  type_name: '`torch.Tensor` of varying shape depending on the modality'
  is_optional: True
  raw_type_name: '`torch.Tensor` of varying shape depending on the modality, *optional*'
- DocstringParam
  description: 'The language to use as target language for translation.'
  kind: param
  key: 'param'
  arg_name: 'tgt_lang'
  type_name: '`str`'
  is_optional: True
  raw_type_name: '`str`, *optional*'
- DocstringParam
  description: |
    The generation configuration to be used as base parametrization for the generation call. `**kwargs`
    passed to generate matching the attributes of `generation_config` will override them. If
    `generation_config` is not provided, the default will be used, which had the following loading
    priority: 1) from the `generation_config.json` model file, if it exists; 2) from the model
    configuration. Please note that unspecified parameters will inherit [`~generation.GenerationConfig`]'s
    default values, whose documentation should be checked to parameterize generation.
  kind: param
  key: 'param'
  arg_name: 'generation_config'
  type_name: '`~generation.GenerationConfig`'
  is_optional: True
  raw_type_name: '`~generation.GenerationConfig`, *optional*'
- DocstringParam
  description: |
    Custom logits processors that complement the default logits processors built from arguments and
    generation config. If a logit processor is passed that is already created with the arguments or a
    generation config an error is thrown. This feature is intended for advanced users.
  kind: param
  key: 'param'
  arg_name: 'logits_processor'
  type_name: '`LogitsProcessorList`'
  is_optional: True
  raw_type_name: '`LogitsProcessorList`, *optional*'
- DocstringParam
  description: |
    Custom stopping criteria that complement the default stopping criteria built from arguments and a
    generation config. If a stopping criteria is passed that is already created with the arguments or a
    generation config an error is thrown. This feature is intended for advanced users.
  kind: param
  key: 'param'
  arg_name: 'stopping_criteria'
  type_name: '`StoppingCriteriaList`'
  is_optional: True
  raw_type_name: '`StoppingCriteriaList`, *optional*'
- DocstringParam
  description: |
    If provided, this function constraints the beam search to allowed tokens only at each step. If not
    provided no constraint is applied. This function takes 2 arguments: the batch ID `batch_id` and
    `input_ids`. It has to return a list with the allowed tokens for the next generation step conditioned
    on the batch ID `batch_id` and the previously generated tokens `inputs_ids`. This argument is useful
    for constrained generation conditioned on the prefix, as described in [Autoregressive Entity
    Retrieval](https://huggingface.co/papers/2010.00904).
  kind: param
  key: 'param'
  arg_name: 'prefix_allowed_tokens_fn'
  type_name: '`Callable[[int, torch.Tensor], list[int]]`'
  is_optional: True
  raw_type_name: '`Callable[[int, torch.Tensor], list[int]]`, *optional*'
- DocstringParam
  description: |
    Whether to continue running the while loop until max_length (needed to avoid deadlocking with
    `FullyShardedDataParallel` and DeepSpeed ZeRO Stage 3).
  kind: param
  key: 'param'
  arg_name: 'synced_gpus'
  type_name: '`bool`'
  is_optional: True
  default: 'False'
  raw_type_name: '`bool`, *optional*, defaults to `False`'
- DocstringParam
  description: |
    Ad hoc parametrization of `generate_config` and/or additional model-specific kwargs that will be
    forwarded to the `forward` function of the model.
  kind: param
  key: 'param'
  arg_name: 'kwargs'
  type_name: '`dict[str, Any]`'
  is_optional: True
  raw_type_name: '`dict[str, Any]`, *optional*'
- DocstringReturns
  description: |
    [`~utils.ModelOutput`] or `torch.LongTensor`: A [`~utils.ModelOutput`] (if `return_dict_in_generate=True`
    or when `config.return_dict_in_generate=True`) or a `torch.Tensor`. The possible
    [`~utils.ModelOutput`] types are:
        - [`~generation.GenerateEncoderDecoderOutput`],
        - [`~generation.GenerateBeamEncoderDecoderOutput`]
  kind: returns
  key: 'returns'
  is_generator: False
=== detect
google
=== compose google
Generates sequences of token ids.

<Tip warning={true}>

Most generation-controlling parameters are set in `generation_config` which, if not passed, will be set to the
model's default generation configuration. You can override any `generation_config` by passing the corresponding
parameters to generate(), e.g. `.generate(inputs, num_beams=4, do_sample=True)`.

For an overview of generation strategies and code examples, check out the [following
guide](./generation_strategies).

</Tip>

Args:
    input_ids (`torch.Tensor` of varying shape depending on the modality, *optional*): Indices of input sequence tokens in the vocabulary.

        Indices can be obtained using [`SeamlessM4TTokenizer`] or [`SeamlessM4TProcessor`]. See
        [`PreTrainedTokenizer.encode`] and [`PreTrainedTokenizer.__call__`] for details.

        [What are input IDs?](../glossary#input-ids)
    tgt_lang (`str`, *optional*): The language to use as target language for translation.
    generation_config (`~generation.GenerationConfig`, *optional*): The generation configuration to be used as base parametrization for the generation call. `**kwargs`
        passed to generate matching the attributes of `generation_config` will override them. If
        `generation_config` is not provided, the default will be used, which had the following loading
        priority: 1) from the `generation_config.json` model file, if it exists; 2) from the model
        configuration. Please note that unspecified parameters will inherit [`~generation.GenerationConfig`]'s
        default values, whose documentation should be checked to parameterize generation.
    logits_processor (`LogitsProcessorList`, *optional*): Custom logits processors that complement the default logits processors built from arguments and
        generation config. If a logit processor is passed that is already created with the arguments or a
        generation config an error is thrown. This feature is intended for advanced users.
    stopping_criteria (`StoppingCriteriaList`, *optional*): Custom stopping criteria that complement the default stopping criteria built from arguments and a
        generation config. If a stopping criteria is passed that is already created with the arguments or a
        generation config an error is thrown. This feature is intended for advanced users.
    prefix_allowed_tokens_fn (`Callable[[int, torch.Tensor], list[int]]`, *optional*): If provided, this function constraints the beam search to allowed tokens only at each step. If not
        provided no constraint is applied. This function takes 2 arguments: the batch ID `batch_id` and
        `input_ids`. It has to return a list with the allowed tokens for the next generation step conditioned
        on the batch ID `batch_id` and the previously generated tokens `inputs_ids`. This argument is useful
        for constrained generation conditioned on the prefix, as described in [Autoregressive Entity
        Retrieval](https://huggingface.co/papers/2010.00904).
    synced_gpus (`bool`, *optional*, defaults to `False`): Whether to continue running the while loop until max_length (needed to avoid deadlocking with
        `FullyShardedDataParallel` and DeepSpeed ZeRO Stage 3).
    kwargs (`dict[str, Any]`, *optional*): Ad hoc parametrization of `generate_config` and/or additional model-specific kwargs that will be
        forwarded to the `forward` function of the model.

Returns:
    [`~utils.ModelOutput`] or `torch.LongTensor`: A [`~utils.ModelOutput`] (if `return_dict_in_generate=True`
    or when `config.return_dict_in_generate=True`) or a `torch.Tensor`. The possible
    [`~utils.ModelOutput`] types are:
        - [`~generation.GenerateEncoderDecoderOutput`],
        - [`~generation.GenerateBeamEncoderDecoderOutput`]
