diff --git a/docs/source/en/model_doc/vilt.mdx b/docs/source/en/model_doc/vilt.mdx index b6b87e7aa5e2..d02f376ebddc 100644 --- a/docs/source/en/model_doc/vilt.mdx +++ b/docs/source/en/model_doc/vilt.mdx @@ -49,6 +49,11 @@ alt="drawing" width="600"/> This model was contributed by [nielsr](https://huggingface.co/nielsr). The original code can be found [here](https://github.com/dandelin/ViLT). + +Tips: + +- The PyTorch version of this model is only available in torch 1.10 and higher. + ## ViltConfig [[autodoc]] ViltConfig diff --git a/tests/models/vilt/test_modeling_vilt.py b/tests/models/vilt/test_modeling_vilt.py index 280eff70d979..30e44d4d488c 100644 --- a/tests/models/vilt/test_modeling_vilt.py +++ b/tests/models/vilt/test_modeling_vilt.py @@ -41,6 +41,9 @@ ViltModel, ) from transformers.models.vilt.modeling_vilt import VILT_PRETRAINED_MODEL_ARCHIVE_LIST + from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_10 +else: + is_torch_greater_or_equal_than_1_10 = False if is_vision_available(): import PIL @@ -214,6 +217,7 @@ def prepare_pixel_values(self): @require_torch +@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+") class ViltModelTest(ModelTesterMixin, unittest.TestCase): all_model_classes = ( ( @@ -510,6 +514,7 @@ def test_model_from_pretrained(self): @require_torch +@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+") class ViltForImagesAndTextClassificationModelTest(ViltModelTest, unittest.TestCase): all_model_classes = (ViltForImagesAndTextClassification,) if is_torch_available() else () @@ -534,6 +539,7 @@ def prepare_img(): @require_torch @require_vision +@unittest.skipIf(not is_torch_greater_or_equal_than_1_10, "Vilt is only available in torch v1.10+") class ViltModelIntegrationTest(unittest.TestCase): @cached_property def default_processor(self):