Pix2StructImageProcessor requires torch>=1.11.0 (#24270)

* fix

* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2023-06-14 17:05:40 +02:00
committed by GitHub
parent 8978b696d7
commit a04ebc8b33
6 changed files with 45 additions and 2 deletions

View File

@@ -48,6 +48,9 @@ if is_torch_available():
Pix2StructVisionModel,
)
from transformers.models.pix2struct.modeling_pix2struct import PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST
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():
@@ -697,6 +700,10 @@ def prepare_img():
return im
@unittest.skipIf(
not is_torch_greater_or_equal_than_1_11,
reason="`Pix2StructImageProcessor` requires `torch>=1.11.0`.",
)
@require_vision
@require_torch
@slow