

from typing import TYPE_CHECKING

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


snake_case_        =			{
    '''configuration_funnel''': ['''FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''FunnelConfig'''],
    '''convert_funnel_original_tf_checkpoint_to_pytorch''': [],
    '''tokenization_funnel''': ['''FunnelTokenizer'''],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       snake_case_        =			['''FunnelTokenizerFast''']

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       snake_case_        =			[
           '''FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''FunnelBaseModel''',
           '''FunnelForMaskedLM''',
           '''FunnelForMultipleChoice''',
           '''FunnelForPreTraining''',
           '''FunnelForQuestionAnswering''',
           '''FunnelForSequenceClassification''',
           '''FunnelForTokenClassification''',
           '''FunnelModel''',
           '''FunnelPreTrainedModel''',
           '''load_tf_weights_in_funnel''',
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       snake_case_        =			[
           '''TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''TFFunnelBaseModel''',
           '''TFFunnelForMaskedLM''',
           '''TFFunnelForMultipleChoice''',
           '''TFFunnelForPreTraining''',
           '''TFFunnelForQuestionAnswering''',
           '''TFFunnelForSequenceClassification''',
           '''TFFunnelForTokenClassification''',
           '''TFFunnelModel''',
           '''TFFunnelPreTrainedModel''',
       ]


if TYPE_CHECKING:
       from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
       from .tokenization_funnel import FunnelTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_funnel_fast import FunnelTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_funnel import (
                  FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FunnelBaseModel,
                  FunnelForMaskedLM,
                  FunnelForMultipleChoice,
                  FunnelForPreTraining,
                  FunnelForQuestionAnswering,
                  FunnelForSequenceClassification,
                  FunnelForTokenClassification,
                  FunnelModel,
                  FunnelPreTrainedModel,
                  load_tf_weights_in_funnel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_funnel import (
                  TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFFunnelBaseModel,
                  TFFunnelForMaskedLM,
                  TFFunnelForMultipleChoice,
                  TFFunnelForPreTraining,
                  TFFunnelForQuestionAnswering,
                  TFFunnelForSequenceClassification,
                  TFFunnelForTokenClassification,
                  TFFunnelModel,
                  TFFunnelPreTrainedModel,
              )

else:
       import sys

       snake_case_        =			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader


class 				SCREAMING_SNAKE_CASE__ (__snake_case					):





    def __init__(				self						,       a						,       a = None						,       a = None						,       a = True						,       a = None						,       a = False						,       a = None						,       a = True						,       a = "arrow"						,       **a						,       ):
         super().__init__(
             split=a						,       features=a						,       cache_dir=a						,       keep_in_memory=a						,       streaming=a						,       **a						,       )
         lowercase__   :       Optional[int]				=	load_from_cache_file
         lowercase__   :       Optional[int]				=	file_format
         lowercase__   :       int				=	Spark(
             df=a						,       features=a						,       cache_dir=a						,       working_dir=a						,       **a						,       )





    def 				snake_case_    (				self):
         if self.streaming:
              return self.builder.as_streaming_dataset(split=self.split)
         lowercase__   :       Dict				=	None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
         self.builder.download_and_prepare(
             download_mode=a						,       file_format=self._file_format						,       )
         return self.builder.as_dataset(split=self.split)

