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
d51302cc
Unverified
Commit
d51302cc
authored
Feb 08, 2021
by
Lysandre Debut
Committed by
GitHub
Feb 08, 2021
Browse files
Fix slow dpr test (#10059)
* Correct cast to device * Comment back the slow test
parent
12e44af5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
tests/test_modeling_dpr.py
tests/test_modeling_dpr.py
+2
-0
No files found.
tests/test_modeling_dpr.py
View file @
d51302cc
...
...
@@ -265,6 +265,7 @@ class DPRModelIntegrationTest(unittest.TestCase):
def
test_reader_inference
(
self
):
tokenizer
=
DPRReaderTokenizer
.
from_pretrained
(
"facebook/dpr-reader-single-nq-base"
)
model
=
DPRReader
.
from_pretrained
(
"facebook/dpr-reader-single-nq-base"
)
model
.
to
(
torch_device
)
encoded_inputs
=
tokenizer
(
questions
=
"What is love ?"
,
...
...
@@ -273,6 +274,7 @@ class DPRModelIntegrationTest(unittest.TestCase):
padding
=
True
,
return_tensors
=
"pt"
,
)
encoded_inputs
.
to
(
torch_device
)
outputs
=
model
(
**
encoded_inputs
)
...
...
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