




from typing import Callable, Optional

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




class     snake_case__							(_UpperCamelCase   ):
				"""simple docstring"""



				def __init__(      self				:     Dict					,      __lowerCamelCase				:     Callable					,      __lowerCamelCase				:     Optional[Features] = None					,      __lowerCamelCase				:     str = None					,      __lowerCamelCase				:     bool = False					,      __lowerCamelCase				:     bool = False					,      __lowerCamelCase				:     Optional[dict] = None					,      __lowerCamelCase				:     Optional[int] = None					,      **__lowerCamelCase				:     int					,      )					->     Optional[Any]:
							super().__init__(
							    features=__lowerCamelCase					,      cache_dir=__lowerCamelCase					,      keep_in_memory=__lowerCamelCase					,      streaming=__lowerCamelCase					,      num_proc=__lowerCamelCase					,      **__lowerCamelCase					,      )
							a    =			Generator(
							    cache_dir=__lowerCamelCase					,      features=__lowerCamelCase					,      generator=__lowerCamelCase					,      gen_kwargs=__lowerCamelCase					,      **__lowerCamelCase					,      )





				def 							__UpperCAmelCase							(      self				:     str							)					->     str:
							# Build iterable dataset
							if self.streaming:
										a    =			self.builder.as_streaming_dataset(split="train"							)
							# Build regular (map-style) dataset
							else:
										a    =			None
										a    =			None
										a    =			None
										a    =			None

										self.builder.download_and_prepare(
										    download_config=__lowerCamelCase					,      download_mode=__lowerCamelCase					,      verification_mode=__lowerCamelCase					,      base_path=__lowerCamelCase					,      num_proc=self.num_proc					,      )
										a    =			self.builder.as_dataset(
										    split="train"					,      verification_mode=__lowerCamelCase					,      in_memory=self.keep_in_memory							)
							return dataset











"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


__a      =				{"configuration_reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"]}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a      =				["ReformerTokenizer"]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a      =				["ReformerTokenizerFast"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a      =				[
						    "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "ReformerAttention",
						    "ReformerForMaskedLM",
						    "ReformerForQuestionAnswering",
						    "ReformerForSequenceClassification",
						    "ReformerLayer",
						    "ReformerModel",
						    "ReformerModelWithLMHead",
						    "ReformerPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_reformer import ReformerTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_reformer_fast import ReformerTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_reformer import (
												    REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ReformerAttention,
												    ReformerForMaskedLM,
												    ReformerForQuestionAnswering,
												    ReformerForSequenceClassification,
												    ReformerLayer,
												    ReformerModel,
												    ReformerModelWithLMHead,
												    ReformerPreTrainedModel,
												)

else:
						import sys

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