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
7b5e943c
"vscode:/vscode.git/clone" did not exist on "86dd23bb8bef09f1869fd9691bf43ece75c5675a"
Unverified
Commit
7b5e943c
authored
Jan 17, 2023
by
Joao Gante
Committed by
GitHub
Jan 17, 2023
Browse files
Generate: TF contrastive search must pop `use_cache` from `model_kwargs` (#21149)
parent
7f3dab39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/generation/tf_utils.py
src/transformers/generation/tf_utils.py
+2
-0
No files found.
src/transformers/generation/tf_utils.py
View file @
7b5e943c
...
...
@@ -2437,6 +2437,8 @@ class TFGenerationMixin:
else
self
.
generation_config
.
return_dict_in_generate
)
use_cache
=
True
# In contrastive search, we always use cache
model_kwargs
.
pop
(
"use_cache"
,
None
)
use_xla
=
not
tf
.
executing_eagerly
()
# TODO (Joao): fix cache format or find programatic way to detect cache index
# GPT2 and other models has a slightly different cache structure, with a different batch axis
...
...
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