Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions docs/source/en/model_doc/vilt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/models/vilt/test_modeling_vilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = (
(
Expand Down Expand Up @@ -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 ()

Expand All @@ -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):
Expand Down