





'''simple docstring'''


from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
class    a_     (       _lowerCAmelCase							):
     __A  				=    ["image_processor", "tokenizer"]
     __A  				=    "EfficientNetImageProcessor"
     __A  				=    ("BertTokenizer", "BertTokenizerFast")





     def __init__(				self	:      Any			,   lowercase	:      Union[str, Any]			,   lowercase	:      Any		):





        """simple docstring"""




        super().__init__(lowercase			,   lowercase		)





     def __call__(				self	:      str			,   lowercase	:      str=None			,   lowercase	:      Optional[Any]=None			,   lowercase	:      Dict="max_length"			,   lowercase	:      List[str]=64			,   lowercase	:      int=None			,   **lowercase	:      int		):





        """simple docstring"""




        if text is None and images is None:
           raise ValueError("You have to specify either text or images. Both cannot be none."		)

        if text is not None:
           lowercase_    :Dict					    =				self.tokenizer(
               lowercase			,   padding=lowercase			,   max_length=lowercase			,   return_tensors=lowercase			,   **lowercase		)

        if images is not None:
           lowercase_    :List[str]					    =				self.image_processor(lowercase			,   return_tensors=lowercase			,   **lowercase		)

        if text is not None and images is not None:
           lowercase_    :Union[str, Any]					    =				image_features.pixel_values
           return encoding
        elif text is not None:
           return encoding
        else:
           return BatchEncoding(data=dict(**lowercase		)			,   tensor_type=lowercase		)





     def 							lowercase__   (				self	:      Optional[int]			,   *lowercase	:      int			,   **lowercase	:      int		):





        """simple docstring"""




        return self.tokenizer.batch_decode(*lowercase			,   **lowercase		)





     def 							lowercase__   (				self	:      List[str]			,   *lowercase	:      Any			,   **lowercase	:      List[str]		):





        """simple docstring"""




        return self.tokenizer.decode(*lowercase			,   **lowercase		)







     @property
     def 							lowercase__   (				self	:      int		):





        """simple docstring"""




        lowercase_    :Any					    =				self.tokenizer.model_input_names
        lowercase_    :Dict					    =				self.image_processor.model_input_names
        return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names		)		)









'''simple docstring'''


import platform
from argparse import ArgumentParser

import huggingface_hub
import pandas
import pyarrow

from datasets import __version__ as version
from datasets.commands import BaseDatasetsCLICommand
def 							UpperCAmelCase_						(		__lowerCamelCase      :      Optional[int]				):
   return EnvironmentCommand()


class    a_     (       _lowerCAmelCase							):





     @staticmethod
     def 							lowercase__   (				lowercase	:      ArgumentParser		):





        """simple docstring"""




        lowercase_    :Optional[int]					    =				parser.add_parser("env"			,   help="Print relevant system environment info."		)
        download_parser.set_defaults(func=lowercase		)





     def 							lowercase__   (				self	:      List[str]		):





        """simple docstring"""




        lowercase_    :Tuple					    =				{
            "`datasets` version": version,
            "Platform": platform.platform(),
            "Python version": platform.python_version(),
            "Huggingface_hub version": huggingface_hub.__version__,
            "PyArrow version": pyarrow.__version__,
            "Pandas version": pandas.__version__,
        }

        print("\nCopy-and-paste the text below in your GitHub issue.\n"		)
        print(self.format_dict(lowercase		)		)

        return info







     @staticmethod
     def 							lowercase__   (				lowercase	:      Dict		):





        """simple docstring"""




        return "\n".join([F'- {prop}: {val}' for prop, val in d.items()]		) + "\n"


