mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 03:01:07 +06:00
parent
e4682de635
commit
6fbea6d237
@ -200,7 +200,7 @@ class GenerationConfig(PushToHubMixin):
|
||||
The id of the token to force as the first generated token after the `decoder_start_token_id`. Useful for
|
||||
multilingual models like [mBART](../model_doc/mbart) where the first generated token needs to be the target
|
||||
language token.
|
||||
forced_eos_token_id (`Union[int, List[int]]`, *optional*, defaults to `model.config.forced_eos_token_id`):
|
||||
forced_eos_token_id (`int` or List[int]`, *optional*, defaults to `model.config.forced_eos_token_id`):
|
||||
The id of the token to force as the last generated token when `max_length` is reached. Optionally, use a
|
||||
list to set multiple *end-of-sequence* tokens.
|
||||
remove_invalid_values (`bool`, *optional*, defaults to `model.config.remove_invalid_values`):
|
||||
@ -234,7 +234,7 @@ class GenerationConfig(PushToHubMixin):
|
||||
low_memory (`bool`, *optional*):
|
||||
Switch to sequential beam search and sequential topk for contrastive search to reduce peak memory.
|
||||
Used with beam search and contrastive search.
|
||||
watermarking_config (Union[`WatermarkingConfig`, `dict`], *optional*):
|
||||
watermarking_config (`WatermarkingConfig` or `dict`, *optional*):
|
||||
Arguments used to watermark the model outputs by adding a small bias to randomly selected set of "green" tokens.
|
||||
If passed as `Dict`, it will be converted to a `WatermarkingConfig` internally.
|
||||
See [this paper](https://arxiv.org/abs/2306.04634) for more details. Accepts the following keys:
|
||||
@ -284,7 +284,7 @@ class GenerationConfig(PushToHubMixin):
|
||||
encoder_no_repeat_ngram_size (`int`, *optional*, defaults to 0):
|
||||
If set to int > 0, all ngrams of that size that occur in the `encoder_input_ids` cannot occur in the
|
||||
`decoder_input_ids`.
|
||||
decoder_start_token_id (`Union[int, List[int]]`, *optional*):
|
||||
decoder_start_token_id (`int` or `List[int]`, *optional*):
|
||||
If an encoder-decoder model starts decoding with a different token than *bos*, the id of that token or a list of length
|
||||
`batch_size`. Indicating a list enables different start ids for each element in the batch
|
||||
(e.g. multilingual models with different target languages in one batch)
|
||||
@ -323,7 +323,7 @@ class GenerationConfig(PushToHubMixin):
|
||||
|
||||
cache_implementation (`str`, *optional*, default to `None`):
|
||||
Cache class that should be used when generating.
|
||||
cache_config (`Union[CacheConfig, dict]`, *optional*, default to `None`):
|
||||
cache_config (`CacheConfig` or `dict`, *optional*, default to `None`):
|
||||
Arguments used in the key-value cache class can be passed in `cache_config`. Can be passed as a `Dict` and
|
||||
it will be converted to its repsective `CacheConfig` internally.
|
||||
Otherwise can be passed as a `CacheConfig` class matching the indicated `cache_implementation`.
|
||||
|
Loading…
Reference in New Issue
Block a user