From 4e23ee7e8d1382b0c3f06049bdf330f39ef5d3df Mon Sep 17 00:00:00 2001 From: yonigozlan Date: Fri, 13 Sep 2024 15:35:22 +0000 Subject: [PATCH] rebase on main, fix imports in test_processing_common --- tests/test_processing_common.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_processing_common.py b/tests/test_processing_common.py index e338d67c8b904e..4bee79e3bdeb11 100644 --- a/tests/test_processing_common.py +++ b/tests/test_processing_common.py @@ -18,26 +18,31 @@ import json import tempfile - -try: - from typing import Unpack -except ImportError: - from typing_extensions import Unpack - import numpy as np +from transformers import CLIPTokenizerFast, ProcessorMixin from transformers.models.auto.processing_auto import processor_class_from_name from transformers.testing_utils import ( check_json_file_has_correct_format, + require_tokenizers, require_torch, require_vision, ) from transformers.utils import is_vision_available +try: + from typing import Unpack +except ImportError: + from typing_extensions import Unpack +import unittest + + if is_vision_available(): from PIL import Image + from transformers import CLIPImageProcessor + def prepare_image_inputs(): """This function prepares a list of PIL images"""