Skip RWKV test in past CI (#24204)
* fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -28,6 +28,7 @@ logger = logging.get_logger(__name__)
|
|||||||
|
|
||||||
parsed_torch_version_base = version.parse(version.parse(torch.__version__).base_version)
|
parsed_torch_version_base = version.parse(version.parse(torch.__version__).base_version)
|
||||||
|
|
||||||
|
is_torch_greater_or_equal_than_2_0 = parsed_torch_version_base >= version.parse("2.0")
|
||||||
is_torch_greater_or_equal_than_1_10 = parsed_torch_version_base >= version.parse("1.10")
|
is_torch_greater_or_equal_than_1_10 = parsed_torch_version_base >= version.parse("1.10")
|
||||||
is_torch_less_than_1_11 = parsed_torch_version_base < version.parse("1.11")
|
is_torch_less_than_1_11 = parsed_torch_version_base < version.parse("1.11")
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ if is_torch_available():
|
|||||||
RwkvForCausalLM,
|
RwkvForCausalLM,
|
||||||
RwkvModel,
|
RwkvModel,
|
||||||
)
|
)
|
||||||
|
from transformers.pytorch_utils import is_torch_greater_or_equal_than_2_0
|
||||||
|
else:
|
||||||
|
is_torch_greater_or_equal_than_2_0 = False
|
||||||
|
|
||||||
|
|
||||||
class RwkvModelTester:
|
class RwkvModelTester:
|
||||||
@@ -258,6 +261,9 @@ class RwkvModelTester:
|
|||||||
return config, inputs_dict
|
return config, inputs_dict
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(
|
||||||
|
not is_torch_greater_or_equal_than_2_0, reason="See https://github.com/huggingface/transformers/pull/24204"
|
||||||
|
)
|
||||||
@require_torch
|
@require_torch
|
||||||
class RwkvModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin, unittest.TestCase):
|
class RwkvModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin, unittest.TestCase):
|
||||||
all_model_classes = (RwkvModel, RwkvForCausalLM) if is_torch_available() else ()
|
all_model_classes = (RwkvModel, RwkvForCausalLM) if is_torch_available() else ()
|
||||||
@@ -418,6 +424,9 @@ class RwkvModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin
|
|||||||
self.assertIsNotNone(model)
|
self.assertIsNotNone(model)
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(
|
||||||
|
not is_torch_greater_or_equal_than_2_0, reason="See https://github.com/huggingface/transformers/pull/24204"
|
||||||
|
)
|
||||||
@slow
|
@slow
|
||||||
class RWKVIntegrationTests(unittest.TestCase):
|
class RWKVIntegrationTests(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user