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
c99f2547
Unverified
Commit
c99f2547
authored
Dec 07, 2023
by
fxmarty
Committed by
GitHub
Dec 07, 2023
Browse files
Fix device of masks in tests (#27887)
fix device of mask in tests
parent
fc71e815
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
tests/models/llama/test_modeling_llama.py
tests/models/llama/test_modeling_llama.py
+1
-1
tests/models/mistral/test_modeling_mistral.py
tests/models/mistral/test_modeling_mistral.py
+1
-1
tests/models/persimmon/test_modeling_persimmon.py
tests/models/persimmon/test_modeling_persimmon.py
+1
-1
No files found.
tests/models/llama/test_modeling_llama.py
View file @
c99f2547
...
@@ -104,7 +104,7 @@ class LlamaModelTester:
...
@@ -104,7 +104,7 @@ class LlamaModelTester:
input_mask
=
None
input_mask
=
None
if
self
.
use_input_mask
:
if
self
.
use_input_mask
:
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
.
to
(
torch_device
)
token_type_ids
=
None
token_type_ids
=
None
if
self
.
use_token_type_ids
:
if
self
.
use_token_type_ids
:
...
...
tests/models/mistral/test_modeling_mistral.py
View file @
c99f2547
...
@@ -107,7 +107,7 @@ class MistralModelTester:
...
@@ -107,7 +107,7 @@ class MistralModelTester:
input_mask
=
None
input_mask
=
None
if
self
.
use_input_mask
:
if
self
.
use_input_mask
:
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
.
to
(
torch_device
)
token_type_ids
=
None
token_type_ids
=
None
if
self
.
use_token_type_ids
:
if
self
.
use_token_type_ids
:
...
...
tests/models/persimmon/test_modeling_persimmon.py
View file @
c99f2547
...
@@ -104,7 +104,7 @@ class PersimmonModelTester:
...
@@ -104,7 +104,7 @@ class PersimmonModelTester:
input_mask
=
None
input_mask
=
None
if
self
.
use_input_mask
:
if
self
.
use_input_mask
:
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
input_mask
=
torch
.
tril
(
torch
.
ones
(
self
.
batch_size
,
self
.
seq_length
))
.
to
(
torch_device
)
token_type_ids
=
None
token_type_ids
=
None
if
self
.
use_token_type_ids
:
if
self
.
use_token_type_ids
:
...
...
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