


'''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	):




				def __init__(		self      :			Dict				,   lowerCAmelCase      :			List[str]				,   lowerCAmelCase      :			int = None				,   lowerCAmelCase      :			List[str] = None				,   lowerCAmelCase      :			List[str] = None				,   lowerCAmelCase      :			Union[str, Any] = False				,   lowerCAmelCase      :			str = False				,   lowerCAmelCase      :			Tuple = None				,   **lowerCAmelCase      :			Any				,   )->					Any:

										"""simple docstring"""




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





				def 					a__(		self      :			List[str]				)->					int:

										"""simple docstring"""




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

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






'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase      :      List[Any]            =					{
    """configuration_x_clip""": [
        """XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XCLIPConfig""",
        """XCLIPTextConfig""",
        """XCLIPVisionConfig""",
    ],
    """processing_x_clip""": ["""XCLIPProcessor"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowercase      :      List[str]            =					[
	    """XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """XCLIPModel""",
	    """XCLIPPreTrainedModel""",
	    """XCLIPTextModel""",
	    """XCLIPVisionModel""",
	]

if TYPE_CHECKING:
	from .configuration_x_clip import (
	    XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    XCLIPConfig,
	    XCLIPTextConfig,
	    XCLIPVisionConfig,
	)
	from .processing_x_clip import XCLIPProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_x_clip import (
		    XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
		    XCLIPModel,
		    XCLIPPreTrainedModel,
		    XCLIPTextModel,
		    XCLIPVisionModel,
		)

else:
	import sys

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





