Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/pipelines/test_pipelines_table_question_answering.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
AutoTokenizer,
TableQuestionAnsweringPipeline,
TFAutoModelForTableQuestionAnswering,
is_torch_available,
pipeline,
)
from transformers.testing_utils import (
Expand All @@ -32,6 +33,12 @@
)


if is_torch_available():
from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_12
else:
is_torch_greater_or_equal_than_1_12 = False


@is_pipeline_test
class TQAPipelineTests(unittest.TestCase):
# Putting it there for consistency, but TQA do not have fast tokenizer
Expand Down Expand Up @@ -143,6 +150,7 @@ def test_small_model_tf(self):
},
)

@unittest.skipIf(not is_torch_greater_or_equal_than_1_12, reason="Tapas is only available in torch v1.12+")
@require_torch
def test_small_model_pt(self):
model_id = "lysandre/tiny-tapas-random-wtq"
Expand Down Expand Up @@ -245,6 +253,7 @@ def test_small_model_pt(self):
},
)

@unittest.skipIf(not is_torch_greater_or_equal_than_1_12, reason="Tapas is only available in torch v1.12+")
@require_torch
def test_slow_tokenizer_sqa_pt(self):
model_id = "lysandre/tiny-tapas-random-sqa"
Expand Down Expand Up @@ -486,6 +495,7 @@ def test_slow_tokenizer_sqa_tf(self):
},
)

@unittest.skipIf(not is_torch_greater_or_equal_than_1_12, reason="Tapas is only available in torch v1.12+")
@slow
@require_torch
def test_integration_wtq_pt(self):
Expand Down Expand Up @@ -580,6 +590,7 @@ def test_integration_wtq_tf(self):
]
self.assertListEqual(results, expected_results)

@unittest.skipIf(not is_torch_greater_or_equal_than_1_12, reason="Tapas is only available in torch v1.12+")
@slow
@require_torch
def test_integration_sqa_pt(self):
Expand Down