

'''simple docstring'''

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  (   a__ ):







       def __init__(				self      :			Tuple    ,   __lowercase      :			Any    ,   __lowercase      :			Union[str, Any] = None    ,   __lowercase      :			Dict = None    ,   __lowercase      :			int = None    ,   __lowercase      :			Tuple = False    ,   __lowercase      :			Union[str, Any] = False    ,   __lowercase      :			Tuple = None    ,   **__lowercase      :			Optional[Any]    ,   ):







            """simple docstring"""







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







       def       snake_case (				self      :			Optional[int]   ):







            """simple docstring"""







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

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






'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase       							=				{
    '''configuration_clipseg''': [
        '''CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''CLIPSegConfig''',
        '''CLIPSegTextConfig''',
        '''CLIPSegVisionConfig''',
    ],
    '''processing_clipseg''': ['''CLIPSegProcessor'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase       							=				[
		    '''CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''CLIPSegModel''',
		    '''CLIPSegPreTrainedModel''',
		    '''CLIPSegTextModel''',
		    '''CLIPSegVisionModel''',
		    '''CLIPSegForImageSegmentation''',
		]

if TYPE_CHECKING:
		from .configuration_clipseg import (
		    CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    CLIPSegConfig,
		    CLIPSegTextConfig,
		    CLIPSegVisionConfig,
		)
		from .processing_clipseg import CLIPSegProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_clipseg import (
				    CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST,
				    CLIPSegForImageSegmentation,
				    CLIPSegModel,
				    CLIPSegPreTrainedModel,
				    CLIPSegTextModel,
				    CLIPSegVisionModel,
				)

else:
		import sys

		__UpperCAmelCase       							=				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)