



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowercase		:      str					={'''configuration_yolos''': ['''YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''YolosConfig''', '''YolosOnnxConfig''']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:      List[Any]					=['''YolosFeatureExtractor''']
		_lowercase		:      Optional[Any]					=['''YolosImageProcessor''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:      List[str]					=[
		    '''YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''YolosForObjectDetection''',
		    '''YolosModel''',
		    '''YolosPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_yolos import YolosFeatureExtractor
				from .image_processing_yolos import YolosImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_yolos import (
				    YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    YolosForObjectDetection,
				    YolosModel,
				    YolosPreTrainedModel,
				)


else:
		import sys

		_lowercase		:      Dict					=_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)









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     _A       (	__UpperCAmelCase    ):



       def __init__(		self							:     Optional[int]     ,		__SCREAMING_SNAKE_CASE							:     NestedDataStructureLike[PathLike]     ,		__SCREAMING_SNAKE_CASE							:     Optional[NamedSplit] = None     ,		__SCREAMING_SNAKE_CASE							:     Optional[Features] = None     ,		__SCREAMING_SNAKE_CASE							:     str = None     ,		__SCREAMING_SNAKE_CASE							:     bool = False     ,		__SCREAMING_SNAKE_CASE							:     bool = False     ,		__SCREAMING_SNAKE_CASE							:     Optional[int] = None     ,		**__SCREAMING_SNAKE_CASE							:     List[str]     ,		):


           '''simple docstring'''

           super().__init__(
               __SCREAMING_SNAKE_CASE     ,		split=__SCREAMING_SNAKE_CASE     ,		features=__SCREAMING_SNAKE_CASE     ,		cache_dir=__SCREAMING_SNAKE_CASE     ,		keep_in_memory=__SCREAMING_SNAKE_CASE     ,		streaming=__SCREAMING_SNAKE_CASE     ,		num_proc=__SCREAMING_SNAKE_CASE     ,		**__SCREAMING_SNAKE_CASE     ,		)
           __a						       =				path_or_paths if isinstance(__SCREAMING_SNAKE_CASE     ,		__SCREAMING_SNAKE_CASE) else {self.split: path_or_paths}
           __a						       =				Text(
               cache_dir=__SCREAMING_SNAKE_CASE     ,		data_files=__SCREAMING_SNAKE_CASE     ,		features=__SCREAMING_SNAKE_CASE     ,		**__SCREAMING_SNAKE_CASE     ,		)





       def 		_lowerCamelCase			(		self							:     List[str]):


           '''simple docstring'''

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

               self.builder.download_and_prepare(
                   download_config=__SCREAMING_SNAKE_CASE     ,		download_mode=__SCREAMING_SNAKE_CASE     ,		verification_mode=__SCREAMING_SNAKE_CASE     ,		base_path=__SCREAMING_SNAKE_CASE     ,		num_proc=self.num_proc     ,		)
               __a						       =				self.builder.as_dataset(
                   split=self.split     ,		verification_mode=__SCREAMING_SNAKE_CASE     ,		in_memory=self.keep_in_memory)
           return dataset





