Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
459bc673
Unverified
Commit
459bc673
authored
Aug 30, 2023
by
Joao Gante
Committed by
GitHub
Aug 30, 2023
Browse files
Docs: fix example failing doctest in `generation_strategies.md ` (#25874)
parent
72298178
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
docs/source/en/generation_strategies.md
docs/source/en/generation_strategies.md
+2
-1
No files found.
docs/source/en/generation_strategies.md
View file @
459bc673
...
...
@@ -332,7 +332,8 @@ The diversily penalty ensures the outputs are distinct across groups, and beam s
>>>
outputs
=
model
.
generate
(
**
inputs
,
num_beams
=
5
,
num_beam_groups
=
5
,
max_new_tokens
=
30
,
diversity_penalty
=
1.0
)
>>>
tokenizer
.
decode
(
outputs
[
0
],
skip_special_tokens
=
True
)
'The aim of this project is to create a new type of living system, one that is more sustainable and efficient than the current one.'
'The Design Principles are a set of universal design principles that can be applied to any location, climate and
culture, and they allow us to design the'
```
This guide illustrates the main parameters that enable various decoding strategies. More advanced parameters exist for the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment