Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
6dc4c36a
Unverified
Commit
6dc4c36a
authored
May 04, 2022
by
Yih-Dar
Committed by
GitHub
May 04, 2022
Browse files
minor change on TF Data2Vec test (#17085)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
23619ef6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
src/transformers/models/data2vec/modeling_tf_data2vec_vision.py
...ansformers/models/data2vec/modeling_tf_data2vec_vision.py
+1
-1
tests/models/data2vec/test_modeling_tf_data2vec_vision.py
tests/models/data2vec/test_modeling_tf_data2vec_vision.py
+4
-8
No files found.
src/transformers/models/data2vec/modeling_tf_data2vec_vision.py
View file @
6dc4c36a
...
...
@@ -52,7 +52,7 @@ _EXPECTED_OUTPUT_SHAPE = [1, 197, 768]
_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
]
...
...
tests/models/data2vec/test_modeling_tf_data2vec_vision.py
View file @
6dc4c36a
...
...
@@ -28,17 +28,13 @@ from ...test_configuration_common import ConfigTester
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
...
...
@@ -421,7 +417,7 @@ class TFData2VecVisionModelTest(TFModelTesterMixin, unittest.TestCase):
@
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment