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
ec25306b
Unverified
Commit
ec25306b
authored
Aug 17, 2023
by
Yih-Dar
Committed by
GitHub
Aug 17, 2023
Browse files
Fix MPT CI (#25548)
fix Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
297a6a7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/models/mpt/test_modeling_mpt.py
tests/models/mpt/test_modeling_mpt.py
+3
-3
No files found.
tests/models/mpt/test_modeling_mpt.py
View file @
ec25306b
...
...
@@ -442,7 +442,7 @@ class MptIntegrationTests(unittest.TestCase):
)
input_text
=
"Hello"
expected_output
=
"""
Hello, I
\'
m a new user of the forum. I have a question about the "S
olaris"""
expected_output
=
'
Hello, I
\'
m a new user of the forum. I have a question about the "S
afety"'
inputs
=
tokenizer
(
input_text
,
return_tensors
=
"pt"
)
outputs
=
model
.
generate
(
**
inputs
,
max_new_tokens
=
20
)
...
...
@@ -487,7 +487,7 @@ class MptIntegrationTests(unittest.TestCase):
expected_output
=
[
"Hello my name is Tiffany and I am a mother of two beautiful children. I have been a nanny for over"
,
"Today I am going at the gym and then I am going to go to the grocery store
. I am going to get some food and then
"
,
"Today I am going at the gym and then I am going to go to the grocery store
and get some food. I am going to make
"
,
]
outputs
=
model
.
generate
(
**
inputs
,
max_new_tokens
=
20
)
...
...
@@ -507,7 +507,7 @@ class MptIntegrationTests(unittest.TestCase):
outputs
=
model
(
dummy_input
,
output_hidden_states
=
True
)
expected_slice
=
torch
.
Tensor
([
-
0.25
5
9
,
-
0.21
9
7
,
-
0.
2480
]).
to
(
torch_device
,
torch
.
bfloat16
)
expected_slice
=
torch
.
Tensor
([
-
0.25
3
9
,
-
0.217
8
,
-
0.
1953
]).
to
(
torch_device
,
torch
.
bfloat16
)
predicted_slice
=
outputs
.
hidden_states
[
-
1
][
0
,
0
,
:
3
]
self
.
assertTrue
(
torch
.
allclose
(
expected_slice
,
predicted_slice
,
atol
=
1e-3
,
rtol
=
1e-3
))
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