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
8891193e
Unverified
Commit
8891193e
authored
Dec 15, 2022
by
Younes Belkada
Committed by
GitHub
Dec 15, 2022
Browse files
[Pipeline] fix failing bloom `pipeline` test (#20778)
fix failing `pipeline` test
parent
b9b70b0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/pipelines/test_pipelines_text_generation.py
tests/pipelines/test_pipelines_text_generation.py
+2
-2
No files found.
tests/pipelines/test_pipelines_text_generation.py
View file @
8891193e
...
@@ -284,10 +284,10 @@ class TextGenerationPipelineTests(unittest.TestCase, metaclass=PipelineTestCaseM
...
@@ -284,10 +284,10 @@ class TextGenerationPipelineTests(unittest.TestCase, metaclass=PipelineTestCaseM
],
],
)
)
# torch_dtype
not necessary
# torch_dtype
will be automatically set to float32 if not provided - check: https://github.com/huggingface/transformers/pull/20602
pipe
=
pipeline
(
model
=
"hf-internal-testing/tiny-random-bloom"
,
device_map
=
"auto"
)
pipe
=
pipeline
(
model
=
"hf-internal-testing/tiny-random-bloom"
,
device_map
=
"auto"
)
self
.
assertEqual
(
pipe
.
model
.
device
,
torch
.
device
(
0
))
self
.
assertEqual
(
pipe
.
model
.
device
,
torch
.
device
(
0
))
self
.
assertEqual
(
pipe
.
model
.
lm_head
.
weight
.
dtype
,
torch
.
b
float
16
)
self
.
assertEqual
(
pipe
.
model
.
lm_head
.
weight
.
dtype
,
torch
.
float
32
)
out
=
pipe
(
"This is a test"
)
out
=
pipe
(
"This is a test"
)
self
.
assertEqual
(
self
.
assertEqual
(
out
,
out
,
...
...
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