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
7f043738
Unverified
Commit
7f043738
authored
Nov 21, 2023
by
fxmarty
Committed by
GitHub
Nov 22, 2023
Browse files
Explicitely specify `use_cache=True` in Flash Attention tests (#27635)
explicit use_cache=True
parent
c770600f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
tests/models/mistral/test_modeling_mistral.py
tests/models/mistral/test_modeling_mistral.py
+5
-1
tests/test_modeling_common.py
tests/test_modeling_common.py
+5
-1
No files found.
tests/models/mistral/test_modeling_mistral.py
View file @
7f043738
...
@@ -436,7 +436,11 @@ class MistralModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
...
@@ -436,7 +436,11 @@ class MistralModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
# Just test that a large cache works as expected
# Just test that a large cache works as expected
_
=
model
.
generate
(
_
=
model
.
generate
(
dummy_input
,
attention_mask
=
dummy_attention_mask
,
max_new_tokens
=
max_new_tokens
,
do_sample
=
False
dummy_input
,
attention_mask
=
dummy_attention_mask
,
max_new_tokens
=
max_new_tokens
,
do_sample
=
False
,
use_cache
=
True
,
)
)
@
require_flash_attn
@
require_flash_attn
...
...
tests/test_modeling_common.py
View file @
7f043738
...
@@ -3166,7 +3166,11 @@ class ModelTesterMixin:
...
@@ -3166,7 +3166,11 @@ class ModelTesterMixin:
# Just test that a large cache works as expected
# Just test that a large cache works as expected
_
=
model
.
generate
(
_
=
model
.
generate
(
dummy_input
,
attention_mask
=
dummy_attention_mask
,
max_new_tokens
=
max_new_tokens
,
do_sample
=
False
dummy_input
,
attention_mask
=
dummy_attention_mask
,
max_new_tokens
=
max_new_tokens
,
do_sample
=
False
,
use_cache
=
True
,
)
)
@
require_flash_attn
@
require_flash_attn
...
...
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