Skip to content

Commit

Permalink
[Tests] Improve vision tests (#14458)
Browse files Browse the repository at this point in the history
* Improve tests

* Install vision for tf tests
  • Loading branch information
NielsRogge authored Nov 24, 2021
1 parent f2e90bc commit 3772af4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ jobs:
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech]
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech,vision]
- save_cache:
key: v0.4-tf-{{ checksum "setup.py" }}
paths:
Expand Down Expand Up @@ -310,7 +310,7 @@ jobs:
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run: pip install --upgrade pip
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech]
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech,vision]
- save_cache:
key: v0.4-tf-{{ checksum "setup.py" }}
paths:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/self-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
run: |
apt -y update && apt install -y libsndfile1-dev git
pip install --upgrade pip
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech]
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech,vision]
- name: Are GPUs recognized by our DL frameworks
run: |
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
run: |
apt -y update && apt install -y libsndfile1-dev git
pip install --upgrade pip
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech]
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech,vision]
- name: Are GPUs recognized by our DL frameworks
run: |
Expand Down
1 change: 1 addition & 0 deletions tests/test_modeling_beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def prepare_img():
return image


@require_torch
@require_vision
class BeitModelIntegrationTest(unittest.TestCase):
@cached_property
Expand Down
1 change: 1 addition & 0 deletions tests/test_modeling_deit.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def prepare_img():
return image


@require_torch
@require_vision
class DeiTModelIntegrationTest(unittest.TestCase):
@cached_property
Expand Down
3 changes: 2 additions & 1 deletion tests/test_modeling_tf_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def test_for_image_classification(self):
@slow
def test_model_from_pretrained(self):

model = TFViTModel.from_pretrained("google/vit-base-patch16-224", from_pt=True)
model = TFViTModel.from_pretrained("google/vit-base-patch16-224")
self.assertIsNotNone(model)


Expand All @@ -363,6 +363,7 @@ def prepare_img():
return image


@require_tf
@require_vision
class TFViTModelIntegrationTest(unittest.TestCase):
@cached_property
Expand Down
1 change: 1 addition & 0 deletions tests/test_modeling_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def prepare_img():
return image


@require_torch
@require_vision
class ViTModelIntegrationTest(unittest.TestCase):
@cached_property
Expand Down

0 comments on commit 3772af4

Please sign in to comment.