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
58fb3c9f
Unverified
Commit
58fb3c9f
authored
Jun 01, 2022
by
Yih-Dar
Committed by
GitHub
Jun 01, 2022
Browse files
Fix Tapas tests (#17510)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
ca1f1c86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
tests/models/tapas/test_modeling_tapas.py
tests/models/tapas/test_modeling_tapas.py
+11
-1
tests/models/tapas/test_tokenization_tapas.py
tests/models/tapas/test_tokenization_tapas.py
+5
-0
No files found.
tests/models/tapas/test_modeling_tapas.py
View file @
58fb3c9f
...
@@ -32,7 +32,13 @@ from transformers import (
...
@@ -32,7 +32,13 @@ from transformers import (
is_torch_available
,
is_torch_available
,
)
)
from
transformers.models.auto
import
get_values
from
transformers.models.auto
import
get_values
from
transformers.testing_utils
import
require_scatter
,
require_torch
,
slow
,
torch_device
from
transformers.testing_utils
import
(
require_scatter
,
require_tensorflow_probability
,
require_torch
,
slow
,
torch_device
,
)
from
transformers.utils
import
cached_property
from
transformers.utils
import
cached_property
from
...test_configuration_common
import
ConfigTester
from
...test_configuration_common
import
ConfigTester
...
@@ -499,6 +505,10 @@ class TapasModelTest(ModelTesterMixin, unittest.TestCase):
...
@@ -499,6 +505,10 @@ class TapasModelTest(ModelTesterMixin, unittest.TestCase):
config_and_inputs
=
self
.
model_tester
.
prepare_config_and_inputs
()
config_and_inputs
=
self
.
model_tester
.
prepare_config_and_inputs
()
self
.
model_tester
.
create_and_check_for_sequence_classification
(
*
config_and_inputs
)
self
.
model_tester
.
create_and_check_for_sequence_classification
(
*
config_and_inputs
)
@
require_tensorflow_probability
def
test_pt_tf_model_equivalence
(
self
):
super
().
test_pt_tf_model_equivalence
()
def
prepare_tapas_single_inputs_for_inference
():
def
prepare_tapas_single_inputs_for_inference
():
# Here we prepare a single table-question pair to test TAPAS inference on:
# Here we prepare a single table-question pair to test TAPAS inference on:
...
...
tests/models/tapas/test_tokenization_tapas.py
View file @
58fb3c9f
...
@@ -36,6 +36,7 @@ from transformers.testing_utils import (
...
@@ -36,6 +36,7 @@ from transformers.testing_utils import (
is_pt_tf_cross_test
,
is_pt_tf_cross_test
,
require_pandas
,
require_pandas
,
require_scatter
,
require_scatter
,
require_tensorflow_probability
,
require_tokenizers
,
require_tokenizers
,
require_torch
,
require_torch
,
slow
,
slow
,
...
@@ -141,6 +142,10 @@ class TapasTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
...
@@ -141,6 +142,10 @@ class TapasTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
output_text
=
"unwanted, running"
output_text
=
"unwanted, running"
return
input_text
,
output_text
return
input_text
,
output_text
@
require_tensorflow_probability
def
test_tf_encode_plus_sent_to_model
(
self
):
super
().
test_tf_encode_plus_sent_to_model
()
def
test_rust_and_python_full_tokenizers
(
self
):
def
test_rust_and_python_full_tokenizers
(
self
):
if
not
self
.
test_rust_tokenizer
:
if
not
self
.
test_rust_tokenizer
:
return
return
...
...
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