





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


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

UpperCAmelCase     :     Optional[Any]							=	{
    """Visual-Attention-Network/van-base""": (
        """https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json"""
    ),
}







class     __lowerCAmelCase	(   UpperCamelCase__):
      _lowercase    : Optional[int]            =      """van"""







      def __init__(   self		,				lowerCAmelCase__=2_2_4		,				lowerCAmelCase__=3		,				lowerCAmelCase__=[7, 3, 3, 3]		,				lowerCAmelCase__=[4, 2, 2, 2]		,				lowerCAmelCase__=[6_4, 1_2_8, 3_2_0, 5_1_2]		,				lowerCAmelCase__=[3, 3, 1_2, 3]		,				lowerCAmelCase__=[8, 8, 4, 4]		,				lowerCAmelCase__="gelu"		,				lowerCAmelCase__=0.02		,				lowerCAmelCase__=1E-6		,				lowerCAmelCase__=1E-2		,				lowerCAmelCase__=0.0		,				lowerCAmelCase__=0.0		,				**lowerCAmelCase__		,				)       ->						Dict:



        '''simple docstring'''




        super().__init__(**lowerCAmelCase__							)
        a__     : Any  =image_size
        a__     : Optional[Any]  =num_channels
        a__     : int  =patch_sizes
        a__     : Union[str, Any]  =strides
        a__     : int  =hidden_sizes
        a__     : str  =depths
        a__     : List[str]  =mlp_ratios
        a__     : Union[str, Any]  =hidden_act
        a__     : Dict  =initializer_range
        a__     : Tuple  =layer_norm_eps
        a__     : Tuple  =layer_scale_init_value
        a__     : str  =drop_path_rate
        a__     : Union[str, Any]  =dropout_rate













from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader







class     __lowerCAmelCase	(   UpperCamelCase__):







      def __init__(   self		,				lowerCAmelCase__		,				lowerCAmelCase__ = None		,				lowerCAmelCase__ = None		,				lowerCAmelCase__ = None		,				lowerCAmelCase__ = False		,				lowerCAmelCase__ = False		,				lowerCAmelCase__ = None		,				**lowerCAmelCase__		,				)       ->						int:



        '''simple docstring'''




        super().__init__(
            lowerCAmelCase__		,				split=lowerCAmelCase__		,				features=lowerCAmelCase__		,				cache_dir=lowerCAmelCase__		,				keep_in_memory=lowerCAmelCase__		,				streaming=lowerCAmelCase__		,				num_proc=lowerCAmelCase__		,				**lowerCAmelCase__		,				)
        a__     : Tuple  =path_or_paths if isinstance(lowerCAmelCase__		,				lowerCAmelCase__							) else {self.split: path_or_paths}
        a__     : List[str]  =Text(
            cache_dir=lowerCAmelCase__		,				data_files=lowerCAmelCase__		,				features=lowerCAmelCase__		,				**lowerCAmelCase__		,				)







      def        _lowercase  (   self							)       ->						List[Any]:



        '''simple docstring'''




        if self.streaming:
          a__     : str  =self.builder.as_streaming_dataset(split=self.split							)
        # Build regular (map-style) dataset
        else:
          a__     : Dict  =None
          a__     : Optional[Any]  =None
          a__     : Union[str, Any]  =None
          a__     : Tuple  =None

          self.builder.download_and_prepare(
              download_config=lowerCAmelCase__		,				download_mode=lowerCAmelCase__		,				verification_mode=lowerCAmelCase__		,				base_path=lowerCAmelCase__		,				num_proc=self.num_proc		,				)
          a__     : Tuple  =self.builder.as_dataset(
              split=self.split		,				verification_mode=lowerCAmelCase__		,				in_memory=self.keep_in_memory							)
        return dataset






