Skip to content

Commit

Permalink
minor change on TF Data2Vec test (huggingface#17085)
Browse files Browse the repository at this point in the history
Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
2 people authored and Narsil committed May 12, 2022
1 parent 0449024 commit 587df42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
_IMAGE_CLASS_CHECKPOINT = "facebook/data2vec-vision-base-ft1k"
_IMAGE_CLASS_EXPECTED_OUTPUT = "remote control, remote"

DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = [
TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = [
"facebook/data2vec-vision-base-ft1k",
# See all Data2VecVision models at https://huggingface.co/models?filter=data2vec-vision
]
Expand Down
12 changes: 4 additions & 8 deletions tests/models/data2vec/test_modeling_tf_data2vec_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor


DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = [
"facebook/data2vec-vision-base-ft1k",
# See all Data2VecVision models at https://huggingface.co/models?filter=data2vec-vision
]


if is_tf_available():
import tensorflow as tf

from transformers import TFData2VecVisionForImageClassification, TFData2VecVisionModel

from transformers.models.data2vec.modeling_tf_data2vec_vision import (
TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST,
)

if is_vision_available():
from PIL import Image
Expand Down Expand Up @@ -421,7 +417,7 @@ def test_for_image_classification(self):

@slow
def test_model_from_pretrained(self):
for model_name in DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
for model_name in TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
model = TFData2VecVisionModel.from_pretrained(model_name)
self.assertIsNotNone(model)

Expand Down

0 comments on commit 587df42

Please sign in to comment.