Skip to content

Commit

Permalink
Generate: All logits processors are documented and have examples (#27796
Browse files Browse the repository at this point in the history
)

Co-authored-by: Arthur <[email protected]>
  • Loading branch information
gante and ArthurZucker authored Dec 7, 2023
1 parent 47500b1 commit 58e7f9b
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 118 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/llm_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ While the autoregressive generation process is relatively straightforward, makin
1. [Guide](generation_strategies) on how to control different generation methods, how to set up the generation configuration file, and how to stream the output;
2. [Guide](chat_templating) on the prompt template for chat LLMs;
3. [Guide](tasks/prompting) on to get the most of prompt design;
4. API reference on [`~generation.GenerationConfig`], [`~generation.GenerationMixin.generate`], and [generate-related classes](internal/generation_utils).
4. API reference on [`~generation.GenerationConfig`], [`~generation.GenerationMixin.generate`], and [generate-related classes](internal/generation_utils). Most of the classes, including the logits processors, have usage examples!

### LLM leaderboards

Expand Down
8 changes: 8 additions & 0 deletions src/transformers/generation/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class GenerationConfig(PushToHubMixin):
You do not need to call any of the above methods directly. Pass custom parameter values to '.generate()'. To learn
more about decoding strategies refer to the [text generation strategies guide](../generation_strategies).
<Tip>
A large number of these flags control the logits or the stopping criteria of the generation. Make sure you check
the [generate-related classes](https://huggingface.co/docs/transformers/internal/generation_utils) for a full
description of the possible manipulations, as well as examples of their usage.
</Tip>
Arg:
> Parameters that control the length of the output
Expand Down
Loading

0 comments on commit 58e7f9b

Please sign in to comment.