Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip test_conditional_generation_pt_pix2struct in Past CI (torch < 1.11) #24417

Merged
merged 1 commit into from
Jun 22, 2023
Merged
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
18 changes: 17 additions & 1 deletion tests/pipelines/test_pipelines_image_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,24 @@

from transformers import MODEL_FOR_VISION_2_SEQ_MAPPING, TF_MODEL_FOR_VISION_2_SEQ_MAPPING, is_vision_available
from transformers.pipelines import pipeline
from transformers.testing_utils import is_pipeline_test, require_tf, require_torch, require_vision, slow
from transformers.testing_utils import (
is_pipeline_test,
is_torch_available,
require_tf,
require_torch,
require_vision,
slow,
)

from .test_pipelines_common import ANY


if is_torch_available():
from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_11
else:
is_torch_greater_or_equal_than_1_11 = False


if is_vision_available():
from PIL import Image
else:
Expand Down Expand Up @@ -204,6 +217,9 @@ def test_conditional_generation_pt_git(self):
with self.assertRaises(ValueError):
outputs = pipe([image, image], prompt=[prompt, prompt])

@unittest.skipIf(
not is_torch_greater_or_equal_than_1_11, reason="`Pix2StructImageProcessor` requires `torch>=1.11.0`."
)
@slow
@require_torch
def test_conditional_generation_pt_pix2struct(self):
Expand Down