diff --git a/src/transformers/image_processing_utils_fast.py b/src/transformers/image_processing_utils_fast.py index d21d35212144..f990ce100d9d 100644 --- a/src/transformers/image_processing_utils_fast.py +++ b/src/transformers/image_processing_utils_fast.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from concurrent.futures import ThreadPoolExecutor from functools import lru_cache, partial from typing import Any, Dict, Iterable, List, Optional, Tuple, TypedDict, Union @@ -497,8 +496,10 @@ def _prepare_input_images( input_data_format=input_data_format, device=device, ) - with ThreadPoolExecutor() as executor: - processed_images = list(executor.map(process_image_fn, images)) + # todo: yoni - check if we can parallelize this efficiently + processed_images = [] + for image in images: + processed_images.append(process_image_fn(image)) return processed_images