





from typing import TYPE_CHECKING

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


__lowerCamelCase :  Dict										=  {
    """configuration_gpt_neox_japanese""": ["""GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoXJapaneseConfig"""],
    """tokenization_gpt_neox_japanese""": ["""GPTNeoXJapaneseTokenizer"""],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCamelCase :  Dict										=  [
        """GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """GPTNeoXJapaneseForCausalLM""",
        """GPTNeoXJapaneseLayer""",
        """GPTNeoXJapaneseModel""",
        """GPTNeoXJapanesePreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig
    from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_gpt_neox_japanese import (
            GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
            GPTNeoXJapaneseForCausalLM,
            GPTNeoXJapaneseLayer,
            GPTNeoXJapaneseModel,
            GPTNeoXJapanesePreTrainedModel,
        )


else:
    import sys

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







from typing import Callable, Optional

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



class       A__     ( __snake_case    ):





      def __init__(				self ,							A_ ,							A_ = None ,							A_ = None ,							A_ = False ,							A_ = False ,							A_ = None ,							A_ = None ,							**A_ ,							):
       '''simple docstring'''




       super().__init__(
           features=A_ ,							cache_dir=A_ ,							keep_in_memory=A_ ,							streaming=A_ ,							num_proc=A_ ,							**A_ ,							)
       UpperCamelCase			:      Optional[int] 			=     Generator(
           cache_dir=A_ ,							features=A_ ,							generator=A_ ,							gen_kwargs=A_ ,							**A_ ,							)





      def  __UpperCamelCase(				self     ):
       '''simple docstring'''




       if self.streaming:
        UpperCamelCase			:      Optional[Any] 			=     self.builder.as_streaming_dataset(split="train"     )
       # Build regular (map-style) dataset
       else:
        UpperCamelCase			:      Union[str, Any] 			=     None
        UpperCamelCase			:      Union[str, Any] 			=     None
        UpperCamelCase			:      List[Any] 			=     None
        UpperCamelCase			:      List[str] 			=     None

        self.builder.download_and_prepare(
            download_config=A_ ,							download_mode=A_ ,							verification_mode=A_ ,							base_path=A_ ,							num_proc=self.num_proc ,							)
        UpperCamelCase			:      int 			=     self.builder.as_dataset(
            split="train" ,							verification_mode=A_ ,							in_memory=self.keep_in_memory     )
       return dataset
