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
12e44af5
"...composable_kernel.git" did not exist on "0a763c3ec5249a915cb3d97e0fa43a82d3f76600"
Unverified
Commit
12e44af5
authored
Feb 08, 2021
by
sandip
Committed by
GitHub
Feb 08, 2021
Browse files
Integration test for FlauBert (#10022)
parent
24db8cc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
tests/test_modeling_flaubert.py
tests/test_modeling_flaubert.py
+16
-0
No files found.
tests/test_modeling_flaubert.py
View file @
12e44af5
...
@@ -399,3 +399,19 @@ class FlaubertModelTest(ModelTesterMixin, unittest.TestCase):
...
@@ -399,3 +399,19 @@ class FlaubertModelTest(ModelTesterMixin, unittest.TestCase):
for
model_name
in
FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST
[:
1
]:
for
model_name
in
FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST
[:
1
]:
model
=
FlaubertModel
.
from_pretrained
(
model_name
)
model
=
FlaubertModel
.
from_pretrained
(
model_name
)
self
.
assertIsNotNone
(
model
)
self
.
assertIsNotNone
(
model
)
@
require_torch
class
FlaubertModelIntegrationTest
(
unittest
.
TestCase
):
@
slow
def
test_inference_no_head_absolute_embedding
(
self
):
model
=
FlaubertModel
.
from_pretrained
(
"flaubert/flaubert_base_cased"
)
input_ids
=
torch
.
tensor
([[
0
,
345
,
232
,
328
,
740
,
140
,
1695
,
69
,
6078
,
1588
,
2
]])
output
=
model
(
input_ids
)[
0
]
expected_shape
=
torch
.
Size
((
1
,
11
,
768
))
self
.
assertEqual
(
output
.
shape
,
expected_shape
)
expected_slice
=
torch
.
tensor
(
[[[
-
2.6251
,
-
1.4298
,
-
0.0227
],
[
-
2.8510
,
-
1.6387
,
0.2258
],
[
-
2.8114
,
-
1.1832
,
-
0.3066
]]]
)
self
.
assertTrue
(
torch
.
allclose
(
output
[:,
:
3
,
:
3
],
expected_slice
,
atol
=
1e-4
))
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