
from typing import Callable, Optional

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







class 					lowerCamelCase		(  _UpperCamelCase  ):





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





     def 		UpperCAmelCase(self				:   List[str]       )						->						int:
         # Build iterable dataset
         if self.streaming:
             snake_case								= self.builder.as_streaming_dataset(split="train"       )
         # Build regular (map-style) dataset
         else:
             snake_case								= None
             snake_case								= None
             snake_case								= None
             snake_case								= None

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



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_A   =			{
    "configuration_lilt": ["LILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LiltConfig"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A   =			[
       "LILT_PRETRAINED_MODEL_ARCHIVE_LIST",
       "LiltForQuestionAnswering",
       "LiltForSequenceClassification",
       "LiltForTokenClassification",
       "LiltModel",
       "LiltPreTrainedModel",
   ]

if TYPE_CHECKING:
   from .configuration_lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_lilt import (
          LILT_PRETRAINED_MODEL_ARCHIVE_LIST,
          LiltForQuestionAnswering,
          LiltForSequenceClassification,
          LiltForTokenClassification,
          LiltModel,
          LiltPreTrainedModel,
      )

else:
   import sys

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

