
'''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       UpperCAmelCase					(       a_			):





		"""simple docstring"""





		def __init__(     self	,       _snake_case	,       _snake_case = None	,       _snake_case = None	,       _snake_case = None	,       _snake_case = False	,       _snake_case = False	,       _snake_case = None	,       **_snake_case	,       )					->     Optional[int]:
				super().__init__(
				    lowercase__	,       split=lowercase__	,       features=lowercase__	,       cache_dir=lowercase__	,       keep_in_memory=lowercase__	,       streaming=lowercase__	,       num_proc=lowercase__	,       **lowercase__	,       )
				_UpperCamelCase							:			List[str]     =   path_or_paths if isinstance(lowercase__	,       lowercase__  ) else {self.split: path_or_paths}
				_UpperCamelCase							:			int     =   Text(
				    cache_dir=lowercase__	,       data_files=lowercase__	,       features=lowercase__	,       **lowercase__	,       )




		def _lowercase	(     self  )					->     Union[str, Any]:



				if self.streaming:
						_UpperCamelCase							:			Optional[int]     =   self.builder.as_streaming_dataset(split=self.split  )
				# Build regular (map-style) dataset
				else:
						_UpperCamelCase							:			List[Any]     =   None
						_UpperCamelCase							:			Any     =   None
						_UpperCamelCase							:			List[Any]     =   None
						_UpperCamelCase							:			str     =   None

						self.builder.download_and_prepare(
						    download_config=lowercase__	,       download_mode=lowercase__	,       verification_mode=lowercase__	,       base_path=lowercase__	,       num_proc=self.num_proc	,       )
						_UpperCamelCase							:			int     =   self.builder.as_dataset(
						    split=self.split	,       verification_mode=lowercase__	,       in_memory=self.keep_in_memory  )
				return dataset








from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
   if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ...utils.dummy_torch_and_transformers_objects import (
       VersatileDiffusionDualGuidedPipeline,
       VersatileDiffusionImageVariationPipeline,
       VersatileDiffusionPipeline,
       VersatileDiffusionTextToImagePipeline,
   )
else:
   from .modeling_text_unet import UNetFlatConditionModel
   from .pipeline_versatile_diffusion import VersatileDiffusionPipeline
   from .pipeline_versatile_diffusion_dual_guided import VersatileDiffusionDualGuidedPipeline
   from .pipeline_versatile_diffusion_image_variation import VersatileDiffusionImageVariationPipeline
   from .pipeline_versatile_diffusion_text_to_image import VersatileDiffusionTextToImagePipeline


