



from typing import Callable, Optional

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







class     __lowerCAmelCase					(    A		):



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



						"""simple docstring"""






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



			def 					_lowerCamelCase (		self     :						Optional[Any])     ->					Dict:



						"""simple docstring"""






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

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





from typing import TYPE_CHECKING

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


UpperCAmelCase__     = {
    "configuration_ctrl": ["CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig"],
    "tokenization_ctrl": ["CTRLTokenizer"],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__     = [
							    "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "CTRLForSequenceClassification",
							    "CTRLLMHeadModel",
							    "CTRLModel",
							    "CTRLPreTrainedModel",
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__     = [
							    "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TFCTRLForSequenceClassification",
							    "TFCTRLLMHeadModel",
							    "TFCTRLModel",
							    "TFCTRLPreTrainedModel",
							]


if TYPE_CHECKING:
							from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
							from .tokenization_ctrl import CTRLTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_ctrl import (
														    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
														    CTRLForSequenceClassification,
														    CTRLLMHeadModel,
														    CTRLModel,
														    CTRLPreTrainedModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_ctrl import (
														    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFCTRLForSequenceClassification,
														    TFCTRLLMHeadModel,
														    TFCTRLModel,
														    TFCTRLPreTrainedModel,
														)

else:
							import sys

							UpperCAmelCase__     = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
