






"""simple docstring"""







import itertools
from dataclasses import dataclass
from typing import Optional

import pandas as pd
import pyarrow as pa

import datasets
from datasets.table import table_cast







@dataclass
class        _SCREAMING_SNAKE_CASE						(  datasets.BuilderConfig							):





							"""simple docstring"""





							_SCREAMING_SNAKE_CASE    =None







class        _SCREAMING_SNAKE_CASE						(  datasets.ArrowBasedBuilder							):





							"""simple docstring"""





							_SCREAMING_SNAKE_CASE    =PandasConfig




							def  lowercase		(   self:     Tuple    ):

												'''simple docstring'''

												return datasets.DatasetInfo(features=self.config.features    )




							def  lowercase		(   self:     Optional[int]				,		__A:     Optional[int]    ):

												'''simple docstring'''

												if not self.config.data_files:
																	raise ValueError(F'At least one data file must be specified, but got data_files={self.config.data_files}'    )
												a__          =  dl_manager.download_and_extract(self.config.data_files    )
												if isinstance(__a				,		(str, list, tuple)    ):
																	a__          =  data_files
																	if isinstance(__a				,		__a    ):
																						a__          =  [files]
																	# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
																	a__          =  [dl_manager.iter_files(__a    ) for file in files]
																	return [datasets.SplitGenerator(name=datasets.Split.TRAIN				,		gen_kwargs={'''files''': files}    )]
												a__          =  []
												for split_name, files in data_files.items():
																	if isinstance(__a				,		__a    ):
																						a__          =  [files]
																	# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
																	a__          =  [dl_manager.iter_files(__a    ) for file in files]
																	splits.append(datasets.SplitGenerator(name=__a				,		gen_kwargs={'''files''': files}    )    )
												return splits




							def  lowercase		(   self:     Optional[Any]				,		__A:     pa.Table    ):

												'''simple docstring'''

												if self.config.features is not None:
																	# more expensive cast to support nested features with keys in a different order
																	# allows str <-> int/float or str to Audio for example
																	a__          =  table_cast(__a				,		self.config.features.arrow_schema    )
												return pa_table





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

												'''simple docstring'''

												for i, file in enumerate(itertools.chain.from_iterable(__a    )    ):
																	with open(__a				,		'''rb'''    ) as f:
																						a__          =  pa.Table.from_pandas(pd.read_pickle(__a    )    )
																						yield i, self._cast_table(__a    )










"""simple docstring"""







from ...configuration_utils import PretrainedConfig
from ...utils import logging


__a       :	List[str]             = logging.get_logger(__name__)

__a       :	int             = {
    'facebook/vit-mae-base': 'https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json',
    # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae
}







class        _SCREAMING_SNAKE_CASE						(  __snake_case							):





							"""simple docstring"""





							_SCREAMING_SNAKE_CASE    ='vit_mae'




							def __init__(   self:     str				,		__A:     str=768				,		__A:     Union[str, Any]=12				,		__A:     str=12				,		__A:     List[Any]=3072				,		__A:     List[Any]="gelu"				,		__A:     Union[str, Any]=0.0				,		__A:     Tuple=0.0				,		__A:     str=0.0_2				,		__A:     Tuple=1e-12				,		__A:     Dict=224				,		__A:     List[Any]=16				,		__A:     Tuple=3				,		__A:     str=True				,		__A:     Optional[Any]=16				,		__A:     List[Any]=512				,		__A:     Optional[Any]=8				,		__A:     Dict=2048				,		__A:     str=0.7_5				,		__A:     str=False				,		**__A:     Tuple				,		):

												'''simple docstring'''

												super().__init__(**__A    )

												a__          =  hidden_size
												a__          =  num_hidden_layers
												a__          =  num_attention_heads
												a__          =  intermediate_size
												a__          =  hidden_act
												a__          =  hidden_dropout_prob
												a__          =  attention_probs_dropout_prob
												a__          =  initializer_range
												a__          =  layer_norm_eps
												a__          =  image_size
												a__          =  patch_size
												a__          =  num_channels
												a__          =  qkv_bias
												a__          =  decoder_num_attention_heads
												a__          =  decoder_hidden_size
												a__          =  decoder_num_hidden_layers
												a__          =  decoder_intermediate_size
												a__          =  mask_ratio
												a__          =  norm_pix_loss


