





'''simple docstring'''


import tempfile
import unittest

import numpy as np

import transformers
from transformers import GPTaConfig, GPTaTokenizer, is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax, slow

from ...generation.test_flax_utils import FlaxGenerationTesterMixin
from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask


if is_flax_available():
 import jax
 import jax.numpy as jnp

 from transformers.modeling_flax_pytorch_utils import (
     convert_pytorch_state_dict_to_flax,
     load_flax_weights_in_pytorch_model,
 )
 from transformers.models.gpta.modeling_flax_gpta import FlaxGPTaLMHeadModel, FlaxGPTaModel

if is_torch_available():
 import torch
class    a_     :





     def __init__(				self	:      Any			,   lowercase	:      Any			,   lowercase	:      Dict=14			,   lowercase	:      Dict=7			,   lowercase	:      Dict=True			,   lowercase	:      Tuple=True			,   lowercase	:      List[str]=False			,   lowercase	:      Union[str, Any]=True			,   lowercase	:      List[str]=99			,   lowercase	:      List[Any]=32			,   lowercase	:      int=5			,   lowercase	:      List[Any]=4			,   lowercase	:      Dict=37			,   lowercase	:      Union[str, Any]="gelu"			,   lowercase	:      Any=0.1			,   lowercase	:      Dict=0.1			,   lowercase	:      List[str]=512			,   lowercase	:      str=0.02			,   ):





        """simple docstring"""




        lowercase_    :Optional[int]					    =				parent
        lowercase_    :List[str]					    =				batch_size
        lowercase_    :int					    =				seq_length
        lowercase_    :Tuple					    =				is_training
        lowercase_    :List[Any]					    =				use_input_mask
        lowercase_    :Tuple					    =				use_token_type_ids
        lowercase_    :Union[str, Any]					    =				use_labels
        lowercase_    :int					    =				vocab_size
        lowercase_    :List[Any]					    =				hidden_size
        lowercase_    :List[str]					    =				num_hidden_layers
        lowercase_    :List[str]					    =				num_attention_heads
        lowercase_    :Tuple					    =				intermediate_size
        lowercase_    :List[Any]					    =				hidden_act
        lowercase_    :int					    =				hidden_dropout_prob
        lowercase_    :List[str]					    =				attention_probs_dropout_prob
        lowercase_    :str					    =				max_position_embeddings
        lowercase_    :Optional[Any]					    =				initializer_range
        lowercase_    :Dict					    =				None
        lowercase_    :int					    =				vocab_size - 1
        lowercase_    :int					    =				vocab_size - 1
        lowercase_    :int					    =				vocab_size - 1





     def 							lowercase__   (				self	:      str		):





        """simple docstring"""




        lowercase_    :Optional[int]					    =				ids_tensor([self.batch_size, self.seq_length]			,   self.vocab_size		)

        lowercase_    :Any					    =				None
        if self.use_input_mask:
           lowercase_    :List[str]					    =				random_attention_mask([self.batch_size, self.seq_length]		)

        lowercase_    :str					    =				GPTaConfig(
            vocab_size=self.vocab_size			,   n_embd=self.hidden_size			,   n_layer=self.num_hidden_layers			,   n_head=self.num_attention_heads			,   n_positions=self.max_position_embeddings			,   use_cache=lowercase			,   bos_token_id=self.bos_token_id			,   eos_token_id=self.eos_token_id			,   pad_token_id=self.pad_token_id			,   )

        return (config, input_ids, input_mask)





     def 							lowercase__   (				self	:      List[Any]		):





        """simple docstring"""




        lowercase_    :List[Any]					    =				self.prepare_config_and_inputs()
        lowercase_    ,							lowercase_    ,							lowercase_    :Any					    =				config_and_inputs
        lowercase_    :Optional[int]					    =				{"input_ids": input_ids, "attention_mask": attention_mask}
        return config, inputs_dict





     def 							lowercase__   (				self	:      int		):





        """simple docstring"""




        lowercase_    ,							lowercase_    ,							lowercase_    :Union[str, Any]					    =				self.prepare_config_and_inputs()

        lowercase_    :int					    =				floats_tensor([self.batch_size, self.seq_length, self.hidden_size]		)
        lowercase_    :List[Any]					    =				ids_tensor([self.batch_size, self.seq_length]			,   vocab_size=2		)

        return (
            config,
            input_ids,
            attention_mask,
            encoder_hidden_states,
            encoder_attention_mask,
        )





     def 							lowercase__   (				self	:      int			,   lowercase	:      Tuple			,   lowercase	:      Dict			,   lowercase	:      str			,   lowercase	:      Union[str, Any]		):





        """simple docstring"""




        lowercase_    :Any					    =				20
        lowercase_    :str					    =				model_class_name(lowercase		)

        lowercase_    :List[str]					    =				model.init_cache(input_ids.shape[0]			,   lowercase		)
        lowercase_    :List[Any]					    =				jnp.ones((input_ids.shape[0], max_decoder_length)			,   dtype="i4"		)

        lowercase_    :Tuple					    =				jnp.broadcast_to(
            jnp.arange(input_ids.shape[-1] - 1		)[None, :]			,   (input_ids.shape[0], input_ids.shape[-1] - 1)		)
        lowercase_    :Optional[int]					    =				model(
            input_ids[:, :-1]			,   attention_mask=lowercase			,   past_key_values=lowercase			,   position_ids=lowercase			,   )

        lowercase_    :List[Any]					    =				jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]			,   dtype="i4"		)
        lowercase_    :int					    =				model(
            input_ids[:, -1:]			,   attention_mask=lowercase			,   past_key_values=outputs_cache.past_key_values			,   position_ids=lowercase			,   )

        lowercase_    :int					    =				model(lowercase		)

        lowercase_    :Union[str, Any]					    =				np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])		)		)
        self.parent.assertTrue(diff < 1e-3			,   msg=F'Max diff is {diff}'		)







     def 							lowercase__   (				self	:      Union[str, Any]			,   lowercase	:      Any			,   lowercase	:      Dict			,   lowercase	:      Any			,   lowercase	:      Optional[Any]		):





        """simple docstring"""




        lowercase_    :List[Any]					    =				20
        lowercase_    :int					    =				model_class_name(lowercase		)

        lowercase_    :List[Any]					    =				jnp.concatenate(
            [attention_mask, jnp.zeros((attention_mask.shape[0], max_decoder_length - attention_mask.shape[1])		)]			,   axis=-1			,   )

        lowercase_    :Any					    =				model.init_cache(input_ids.shape[0]			,   lowercase		)
        lowercase_    :List[str]					    =				jnp.broadcast_to(
            jnp.arange(input_ids.shape[-1] - 1		)[None, :]			,   (input_ids.shape[0], input_ids.shape[-1] - 1)		)

        lowercase_    :int					    =				model(
            input_ids[:, :-1]			,   attention_mask=lowercase			,   past_key_values=lowercase			,   position_ids=lowercase			,   )
        lowercase_    :List[Any]					    =				jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]			,   dtype="i4"		)
        lowercase_    :Dict					    =				model(
            input_ids[:, -1:]			,   past_key_values=outputs_cache.past_key_values			,   attention_mask=lowercase			,   position_ids=lowercase			,   )

        lowercase_    :Tuple					    =				model(lowercase			,   attention_mask=lowercase		)

        lowercase_    :int					    =				np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])		)		)
        self.parent.assertTrue(diff < 1e-3			,   msg=F'Max diff is {diff}'		)







@require_flax
class    a_     (       _lowerCAmelCase			,		_lowerCAmelCase			,		unittest.TestCase							):
     __A  				=    (FlaxGPTaModel, FlaxGPTaLMHeadModel) if is_flax_available() else ()
     __A  				=    (FlaxGPTaLMHeadModel,) if is_flax_available() else ()





     def 							lowercase__   (				self	:      List[str]		):





        """simple docstring"""




        lowercase_    :Dict					    =				FlaxGPTaModelTester(self		)





     def 							lowercase__   (				self	:      Any		):





        """simple docstring"""




        for model_class_name in self.all_model_classes:
           lowercase_    ,							lowercase_    ,							lowercase_    :Dict					    =				self.model_tester.prepare_config_and_inputs()
           self.model_tester.check_use_cache_forward(lowercase			,   lowercase			,   lowercase			,   lowercase		)





     def 							lowercase__   (				self	:      int		):





        """simple docstring"""




        for model_class_name in self.all_model_classes:
           lowercase_    ,							lowercase_    ,							lowercase_    :Any					    =				self.model_tester.prepare_config_and_inputs()
           self.model_tester.check_use_cache_forward_with_attn_mask(
               lowercase			,   lowercase			,   lowercase			,   lowercase		)





     @slow
     def 							lowercase__   (				self	:      Optional[Any]		):





        """simple docstring"""




        lowercase_    :Optional[int]					    =				GPTaTokenizer.from_pretrained("gpt2"			,   pad_token="</s>"			,   padding_side="left"		)
        lowercase_    :str					    =				tokenizer(["Hello this is a long string", "Hey"]			,   return_tensors="np"			,   padding=lowercase			,   truncation=lowercase		)

        lowercase_    :int					    =				FlaxGPTaLMHeadModel.from_pretrained("gpt2"		)
        lowercase_    :List[str]					    =				False
        lowercase_    :Optional[Any]					    =				model.config.eos_token_id

        lowercase_    :Union[str, Any]					    =				jax.jit(model.generate		)

        lowercase_    :Dict					    =				jit_generate(inputs["input_ids"]			,   attention_mask=inputs["attention_mask"]		).sequences

        lowercase_    :str					    =				tokenizer.batch_decode(lowercase			,   skip_special_tokens=lowercase		)

        lowercase_    :Any					    =				[
            "Hello this is a long string of words. I'm going to start with the first one.\n",
            "Hey, I'm not sure if I'm going to be able to do",
        ]

        self.assertListEqual(lowercase			,   lowercase		)





     @is_pt_flax_cross_test
     def 							lowercase__   (				self	:      Union[str, Any]		):





        """simple docstring"""




        lowercase_    ,							lowercase_    :Union[str, Any]					    =				self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__		):
              # prepare inputs
              lowercase_    :Any					    =				self._prepare_for_class(lowercase			,   lowercase		)
              lowercase_    :List[Any]					    =				{k: torch.tensor(v.tolist()		) for k, v in prepared_inputs_dict.items()}

              # load corresponding PyTorch class
              lowercase_    :List[str]					    =				model_class.__name__[4:]  # Skip the "Flax" at the beginning
              lowercase_    :List[str]					    =				getattr(lowercase			,   lowercase		)

              lowercase_    ,							lowercase_    :Any					    =				pt_inputs["input_ids"].shape
              lowercase_    :str					    =				np.random.randint(0			,   seq_length - 1			,   size=(batch_size,)		)
              for batch_idx, start_index in enumerate(lowercase		):
                 lowercase_    :str					    =				0
                 lowercase_    :str					    =				1
                 lowercase_    :Dict					    =				0
                 lowercase_    :Optional[Any]					    =				1
              lowercase_    :str					    =				pt_model_class(lowercase		).eval()
              lowercase_    :Any					    =				model_class(lowercase			,   dtype=jnp.floataa		)

              lowercase_    :List[Any]					    =				convert_pytorch_state_dict_to_flax(pt_model.state_dict()			,   lowercase		)
              lowercase_    :Optional[Any]					    =				fx_state

              with torch.no_grad():
                 lowercase_    :int					    =				pt_model(**lowercase		).to_tuple()

              lowercase_    :Optional[Any]					    =				fx_model(**lowercase		).to_tuple()
              self.assertEqual(len(lowercase		)			,   len(lowercase		)			,   "Output lengths differ between Flax and PyTorch"		)
              for fx_output, pt_output in zip(lowercase			,   lowercase		):
                 self.assert_almost_equals(fx_output[:, -1]			,   pt_output[:, -1].numpy()			,   4e-2		)

              with tempfile.TemporaryDirectory() as tmpdirname:
                 pt_model.save_pretrained(lowercase		)
                 lowercase_    :str					    =				model_class.from_pretrained(lowercase			,   from_pt=lowercase		)

              lowercase_    :Optional[int]					    =				fx_model_loaded(**lowercase		).to_tuple()
              self.assertEqual(
                  len(lowercase		)			,   len(lowercase		)			,   "Output lengths differ between Flax and PyTorch"		)
              for fx_output_loaded, pt_output in zip(lowercase			,   lowercase		):
                 self.assert_almost_equals(fx_output_loaded[:, -1]			,   pt_output[:, -1].numpy()			,   4e-2		)





     @is_pt_flax_cross_test
     def 							lowercase__   (				self	:      int		):





        """simple docstring"""




        lowercase_    ,							lowercase_    :Dict					    =				self.model_tester.prepare_config_and_inputs_for_common()
        for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__		):
              # prepare inputs
              lowercase_    :List[Any]					    =				self._prepare_for_class(lowercase			,   lowercase		)
              lowercase_    :Dict					    =				{k: torch.tensor(v.tolist()		) for k, v in prepared_inputs_dict.items()}

              # load corresponding PyTorch class
              lowercase_    :Tuple					    =				model_class.__name__[4:]  # Skip the "Flax" at the beginning
              lowercase_    :int					    =				getattr(lowercase			,   lowercase		)

              lowercase_    :Optional[Any]					    =				pt_model_class(lowercase		).eval()
              lowercase_    :Any					    =				model_class(lowercase			,   dtype=jnp.floataa		)

              lowercase_    :Union[str, Any]					    =				load_flax_weights_in_pytorch_model(lowercase			,   fx_model.params		)
              lowercase_    ,							lowercase_    :List[Any]					    =				pt_inputs["input_ids"].shape
              lowercase_    :Any					    =				np.random.randint(0			,   seq_length - 1			,   size=(batch_size,)		)
              for batch_idx, start_index in enumerate(lowercase		):
                 lowercase_    :List[Any]					    =				0
                 lowercase_    :Any					    =				1
                 lowercase_    :Optional[int]					    =				0
                 lowercase_    :int					    =				1

              # make sure weights are tied in PyTorch
              pt_model.tie_weights()

              with torch.no_grad():
                 lowercase_    :Tuple					    =				pt_model(**lowercase		).to_tuple()

              lowercase_    :Dict					    =				fx_model(**lowercase		).to_tuple()
              self.assertEqual(len(lowercase		)			,   len(lowercase		)			,   "Output lengths differ between Flax and PyTorch"		)
              for fx_output, pt_output in zip(lowercase			,   lowercase		):
                 self.assert_almost_equals(fx_output[:, -1]			,   pt_output[:, -1].numpy()			,   4e-2		)

              with tempfile.TemporaryDirectory() as tmpdirname:
                 fx_model.save_pretrained(lowercase		)
                 lowercase_    :str					    =				pt_model_class.from_pretrained(lowercase			,   from_flax=lowercase		)

              with torch.no_grad():
                 lowercase_    :str					    =				pt_model_loaded(**lowercase		).to_tuple()

              self.assertEqual(
                  len(lowercase		)			,   len(lowercase		)			,   "Output lengths differ between Flax and PyTorch"		)
              for fx_output, pt_output in zip(lowercase			,   lowercase		):
                 self.assert_almost_equals(fx_output[:, -1]			,   pt_output[:, -1].numpy()			,   4e-2		)







     @slow
     def 							lowercase__   (				self	:      Any		):





        """simple docstring"""




        for model_class_name in self.all_model_classes:
           lowercase_    :Optional[Any]					    =				model_class_name.from_pretrained("gpt2"			,   from_pt=lowercase		)
           lowercase_    :Tuple					    =				model(np.ones((1, 1)		)		)
           self.assertIsNotNone(lowercase		)









'''simple docstring'''


from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import center_crop, normalize, rescale, resize, to_channel_dimension_format
from ...image_utils import (
    IMAGENET_DEFAULT_MEAN,
    IMAGENET_DEFAULT_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    get_image_size,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
 import PIL


lowerCAmelCase      :  Any      							=logging.get_logger(__name__)
class    a_     (       _lowerCAmelCase							):
     __A  				=    ["pixel_values"]





     def __init__(				self	:      Tuple			,   lowercase	:      bool = True			,   lowercase	:      Dict[str, int] = None			,   lowercase	:      bool = True			,   lowercase	:      Dict[str, int] = None			,   lowercase	:      PILImageResampling = PILImageResampling.BICUBIC			,   lowercase	:      bool = True			,   lowercase	:      Union[int, float] = 1 / 255			,   lowercase	:      bool = True			,   lowercase	:      Optional[Union[float, List[float]]] = None			,   lowercase	:      Optional[Union[float, List[float]]] = None			,   **lowercase	:      int			,   ):





        """simple docstring"""




        super().__init__(**lowercase		)
        lowercase_    :Dict					    =				crop_size if crop_size is not None else {"height": 256, "width": 256}
        lowercase_    :str					    =				get_size_dict(lowercase			,   param_name="crop_size"		)
        lowercase_    :Optional[Any]					    =				size if size is not None else {"height": 224, "width": 224}
        lowercase_    :Union[str, Any]					    =				get_size_dict(lowercase		)

        lowercase_    :Union[str, Any]					    =				do_center_crop
        lowercase_    :str					    =				crop_size
        lowercase_    :List[str]					    =				do_resize
        lowercase_    :str					    =				size
        lowercase_    :Tuple					    =				resample
        lowercase_    :int					    =				do_rescale
        lowercase_    :Union[str, Any]					    =				rescale_factor
        lowercase_    :Tuple					    =				do_normalize
        lowercase_    :List[Any]					    =				image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN
        lowercase_    :Optional[int]					    =				image_std if image_std is not None else IMAGENET_DEFAULT_STD





     def 							lowercase__   (				self	:      Any			,   lowercase	:      np.ndarray			,   lowercase	:      Dict[str, int]			,   lowercase	:      Optional[int] = None			,   lowercase	:      Optional[Union[str, ChannelDimension]] = None			,   **lowercase	:      List[Any]			,   ):





        """simple docstring"""




        lowercase_    :Dict					    =				self.size if size is None else size
        lowercase_    :Dict					    =				get_size_dict(lowercase		)
        lowercase_    :List[Any]					    =				get_size_dict(lowercase			,   param_name="crop_size"		)

        lowercase_    ,							lowercase_    :List[str]					    =				get_image_size(lowercase		)
        lowercase_    :List[str]					    =				min(lowercase			,   lowercase		)
        lowercase_    :Tuple					    =				(size["height"] / crop_size["height"]) * min_dim
        lowercase_    :int					    =				(size["width"] / crop_size["width"]) * min_dim
        return center_crop(lowercase			,   size=(cropped_height, cropped_width)			,   data_format=lowercase			,   **lowercase		)





     def 							lowercase__   (				self	:      Union[str, Any]			,   lowercase	:      np.ndarray			,   lowercase	:      Dict[str, int]			,   lowercase	:      PILImageResampling = PIL.Image.BICUBIC			,   lowercase	:      Optional[Union[str, ChannelDimension]] = None			,   **lowercase	:      List[str]			,   ):





        """simple docstring"""




        lowercase_    :Optional[int]					    =				get_size_dict(lowercase		)
        if "height" not in size or "width" not in size:
           raise ValueError(F'The size dictionary must contain the keys \'height\' and \'width\'. Got {size.keys()}'		)
        return resize(
            lowercase			,   size=(size["height"], size["width"])			,   resample=lowercase			,   data_format=lowercase			,   **lowercase		)





     def 							lowercase__   (				self	:      List[str]			,   lowercase	:      np.ndarray			,   lowercase	:      Union[int, float]			,   lowercase	:      Optional[Union[str, ChannelDimension]] = None			,   **lowercase	:      Union[str, Any]			,   ):





        """simple docstring"""




        return rescale(lowercase			,   scale=lowercase			,   data_format=lowercase			,   **lowercase		)





     def 							lowercase__   (				self	:      List[str]			,   lowercase	:      np.ndarray			,   lowercase	:      Union[float, List[float]]			,   lowercase	:      Union[float, List[float]]			,   lowercase	:      Optional[Union[str, ChannelDimension]] = None			,   **lowercase	:      str			,   ):





        """simple docstring"""




        return normalize(lowercase			,   mean=lowercase			,   std=lowercase			,   data_format=lowercase			,   **lowercase		)







     def 							lowercase__   (				self	:      List[Any]			,   lowercase	:      ImageInput			,   lowercase	:      Optional[bool] = None			,   lowercase	:      Optional[Dict[str, int]] = None			,   lowercase	:      Optional[bool] = None			,   lowercase	:      Optional[Dict[str, int]] = None			,   lowercase	:      PILImageResampling = None			,   lowercase	:      Optional[bool] = None			,   lowercase	:      Optional[float] = None			,   lowercase	:      Optional[bool] = None			,   lowercase	:      Optional[Union[float, List[float]]] = None			,   lowercase	:      Optional[Union[float, List[float]]] = None			,   lowercase	:      Optional[Union[str, TensorType]] = None			,   lowercase	:      ChannelDimension = ChannelDimension.FIRST			,   **lowercase	:      Optional[Any]			,   ):





        """simple docstring"""




        lowercase_    :str					    =				do_center_crop if do_center_crop is not None else self.do_center_crop
        lowercase_    :Union[str, Any]					    =				crop_size if crop_size is not None else self.crop_size
        lowercase_    :Optional[Any]					    =				get_size_dict(lowercase			,   param_name="crop_size"		)
        lowercase_    :Union[str, Any]					    =				do_resize if do_resize is not None else self.do_resize
        lowercase_    :Any					    =				size if size is not None else self.size
        lowercase_    :List[Any]					    =				get_size_dict(lowercase		)
        lowercase_    :Optional[Any]					    =				resample if resample is not None else self.resample
        lowercase_    :Dict					    =				do_rescale if do_rescale is not None else self.do_rescale
        lowercase_    :List[Any]					    =				rescale_factor if rescale_factor is not None else self.rescale_factor
        lowercase_    :str					    =				do_normalize if do_normalize is not None else self.do_normalize
        lowercase_    :Dict					    =				image_mean if image_mean is not None else self.image_mean
        lowercase_    :List[Any]					    =				image_std if image_std is not None else self.image_std

        lowercase_    :Any					    =				make_list_of_images(lowercase		)

        if not valid_images(lowercase		):
           raise ValueError(
               "Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, "
               "torch.Tensor, tf.Tensor or jax.ndarray."		)

        if do_center_crop and crop_size is None:
           raise ValueError("If `do_center_crop` is set to `True`, `crop_size` must be provided."		)

        if do_resize and size is None:
           raise ValueError("Size must be specified if do_resize is True."		)

        if do_rescale and rescale_factor is None:
           raise ValueError("Rescale factor must be specified if do_rescale is True."		)

        if do_normalize and (image_mean is None or image_std is None):
           raise ValueError("Image mean and image standard deviation must be specified if do_normalize is True."		)

        # All transformations expect numpy arrays.
        lowercase_    :Optional[int]					    =				[to_numpy_array(lowercase		) for image in images]

        if do_center_crop:
           lowercase_    :str					    =				[self.center_crop(lowercase			,   lowercase			,   size=lowercase		) for image in images]

        if do_resize:
           lowercase_    :List[str]					    =				[self.resize(image=lowercase			,   size=lowercase			,   resample=lowercase		) for image in images]

        if do_rescale:
           lowercase_    :List[Any]					    =				[self.rescale(image=lowercase			,   scale=lowercase		) for image in images]

        if do_normalize:
           lowercase_    :Optional[Any]					    =				[self.normalize(image=lowercase			,   mean=lowercase			,   std=lowercase		) for image in images]

        lowercase_    :Optional[Any]					    =				[to_channel_dimension_format(lowercase			,   lowercase		) for image in images]

        lowercase_    :Union[str, Any]					    =				{"pixel_values": images}
        return BatchFeature(data=lowercase			,   tensor_type=lowercase		)


