




'''simple docstring'''


from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream

class     A					(	_a					):







							def __init__(						self :						Any							,    lowerCAmelCase_ :						Callable							,    lowerCAmelCase_ :						Optional[Features] = None							,    lowerCAmelCase_ :						str = None							,    lowerCAmelCase_ :						bool = False							,    lowerCAmelCase_ :						bool = False							,    lowerCAmelCase_ :						Optional[dict] = None							,    lowerCAmelCase_ :						Optional[int] = None							,    **lowerCAmelCase_ :						Union[str, Any]							,    )    ->							List[Any]:


														"""simple docstring"""


														super().__init__(
														    features=lowerCAmelCase_							,    cache_dir=lowerCAmelCase_							,    keep_in_memory=lowerCAmelCase_							,    streaming=lowerCAmelCase_							,    num_proc=lowerCAmelCase_							,    **lowerCAmelCase_							,    )
														_a			  =       Generator(
														    cache_dir=lowerCAmelCase_							,    features=lowerCAmelCase_							,    generator=lowerCAmelCase_							,    gen_kwargs=lowerCAmelCase_							,    **lowerCAmelCase_							,    )







							def      __lowerCAmelCase    (						self :						Optional[Any]      )    ->							Optional[int]:


														"""simple docstring"""


														if self.streaming:
																					_a			  =       self.builder.as_streaming_dataset(split='''train'''      )
														# Build regular (map-style) dataset
														else:
																					_a			  =       None
																					_a			  =       None
																					_a			  =       None
																					_a			  =       None

																					self.builder.download_and_prepare(
																					    download_config=lowerCAmelCase_							,    download_mode=lowerCAmelCase_							,    verification_mode=lowerCAmelCase_							,    base_path=lowerCAmelCase_							,    num_proc=self.num_proc							,    )
																					_a			  =       self.builder.as_dataset(
																					    split='''train'''							,    verification_mode=lowerCAmelCase_							,    in_memory=self.keep_in_memory      )
														return dataset







'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_torch_available,
    is_vision_available,
)


_snake_case   :   List[Any]     							=	{'configuration_beit': ['BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BeitConfig', 'BeitOnnxConfig']}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_snake_case   :   Any     							=	['BeitFeatureExtractor']
				_snake_case   :   Any     							=	['BeitImageProcessor']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_snake_case   :   List[str]     							=	[
				    'BEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'BeitForImageClassification',
				    'BeitForMaskedImageModeling',
				    'BeitForSemanticSegmentation',
				    'BeitModel',
				    'BeitPreTrainedModel',
				]


try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_snake_case   :   List[str]     							=	[
				    'FlaxBeitForImageClassification',
				    'FlaxBeitForMaskedImageModeling',
				    'FlaxBeitModel',
				    'FlaxBeitPreTrainedModel',
				]

if TYPE_CHECKING:
				from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_beit import BeitFeatureExtractor
								from .image_processing_beit import BeitImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_beit import (
								    BEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    BeitForImageClassification,
								    BeitForMaskedImageModeling,
								    BeitForSemanticSegmentation,
								    BeitModel,
								    BeitPreTrainedModel,
								)

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_beit import (
								    FlaxBeitForImageClassification,
								    FlaxBeitForMaskedImageModeling,
								    FlaxBeitModel,
								    FlaxBeitPreTrainedModel,
								)


else:
				import sys

				_snake_case   :   Union[str, Any]     							=	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

