Skip GPT-J fx tests for torch < 1.12 (#24256)
* fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,9 @@ if is_torch_available():
|
||||
GPTJForSequenceClassification,
|
||||
GPTJModel,
|
||||
)
|
||||
from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_12
|
||||
else:
|
||||
is_torch_greater_or_equal_than_1_12 = False
|
||||
|
||||
|
||||
class GPTJModelTester:
|
||||
@@ -385,6 +388,18 @@ class GPTJModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin
|
||||
test_model_parallel = False
|
||||
test_head_masking = False
|
||||
|
||||
@unittest.skipIf(
|
||||
not is_torch_greater_or_equal_than_1_12, reason="PR #22069 made changes that require torch v1.12+."
|
||||
)
|
||||
def test_torch_fx(self):
|
||||
super().test_torch_fx()
|
||||
|
||||
@unittest.skipIf(
|
||||
not is_torch_greater_or_equal_than_1_12, reason="PR #22069 made changes that require torch v1.12+."
|
||||
)
|
||||
def test_torch_fx_output_loss(self):
|
||||
super().test_torch_fx_output_loss()
|
||||
|
||||
# TODO: Fix the failed tests
|
||||
def is_pipeline_test_to_skip(
|
||||
self, pipeline_test_casse_name, config_class, model_architecture, tokenizer_name, processor_name
|
||||
|
||||
Reference in New Issue
Block a user