Skip to content

Commit 6e195eb

Browse files
jadermcsJader Martins
andauthored
docs for typical decoding (huggingface#17186)
Co-authored-by: Jader Martins <[email protected]>
1 parent 060fe61 commit 6e195eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/transformers/generation_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,9 @@ def generate(
941941
top_p (`float`, *optional*, defaults to 1.0):
942942
If set to float < 1, only the most probable tokens with probabilities that add up to `top_p` or higher
943943
are kept for generation.
944+
typical_p (`float`, *optional*, defaults to 1.0):
945+
The amount of probability mass from the original distribution to be considered in typical decoding.
946+
If set to 1.0 it takes no effect. See [this paper](https://arxiv.org/pdf/2202.00666.pdf) for more details.
944947
repetition_penalty (`float`, *optional*, defaults to 1.0):
945948
The parameter for repetition penalty. 1.0 means no penalty. See [this
946949
paper](https://arxiv.org/pdf/1909.05858.pdf) for more details.

0 commit comments

Comments
 (0)