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
c58e6c12
Unverified
Commit
c58e6c12
authored
Jun 06, 2020
by
Sam Shleifer
Committed by
GitHub
Jun 06, 2020
Browse files
[marian tests ] pass device to pipeline (#4815)
parent
ddf9a3df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tests/test_modeling_marian.py
tests/test_modeling_marian.py
+2
-1
No files found.
tests/test_modeling_marian.py
View file @
c58e6c12
...
...
@@ -233,7 +233,8 @@ class TestMarian_en_ROMANCE(MarianIntegrationTest):
self
.
tokenizer
.
prepare_translation_batch
([
""
])
def
test_pipeline
(
self
):
pipeline
=
TranslationPipeline
(
self
.
model
,
self
.
tokenizer
,
framework
=
"pt"
)
device
=
0
if
torch_device
==
"cuda"
else
-
1
pipeline
=
TranslationPipeline
(
self
.
model
,
self
.
tokenizer
,
framework
=
"pt"
,
device
=
device
)
output
=
pipeline
(
self
.
src_text
)
self
.
assertEqual
(
self
.
expected_text
,
[
x
[
"translation_text"
]
for
x
in
output
])
...
...
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