


'''simple docstring'''







from typing import Callable, Optional

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


class 			__lowerCamelCase			(	SCREAMING_SNAKE_CASE__	):
    """simple docstring"""


    def __init__(  self      :							Optional[Any]				,							SCREAMING_SNAKE_CASE      :							int				,							SCREAMING_SNAKE_CASE      :							str = None				,							SCREAMING_SNAKE_CASE      :							Dict = None				,							SCREAMING_SNAKE_CASE      :							Any = False				,							SCREAMING_SNAKE_CASE      :							Any = False				,							SCREAMING_SNAKE_CASE      :							Dict = None				,							SCREAMING_SNAKE_CASE      :							List[str] = None				,							**SCREAMING_SNAKE_CASE      :							str				,							):
           super().__init__(
               features=A__				,							cache_dir=A__				,							keep_in_memory=A__				,							streaming=A__				,							num_proc=A__				,							**A__				,							)
           _A					:     str     = Generator(
               cache_dir=A__				,							features=A__				,							generator=A__				,							gen_kwargs=A__				,							**A__				,							)


    def        A   (  self      :							List[str]):
           # Build iterable dataset
           if self.streaming:
                  _A					:     Any     = self.builder.as_streaming_dataset(split='train')
           # Build regular (map-style) dataset
           else:
                  _A					:     Union[str, Any]     = None
                  _A					:     Dict     = None
                  _A					:     str     = None
                  _A					:     int     = None

                  self.builder.download_and_prepare(
                      download_config=A__				,							download_mode=A__				,							verification_mode=A__				,							base_path=A__				,							num_proc=self.num_proc				,							)
                  _A					:     Optional[int]     = self.builder.as_dataset(
                      split='train'				,							verification_mode=A__				,							in_memory=self.keep_in_memory)
           return dataset



'''simple docstring'''







from typing import TYPE_CHECKING

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


A				:					str    						=			{
    '''configuration_blip''': [
        '''BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''BlipConfig''',
        '''BlipTextConfig''',
        '''BlipVisionConfig''',
    ],
    '''processing_blip''': ['''BlipProcessor'''],
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A				:					Optional[Any]    						=			['''BlipImageProcessor''']


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A				:					List[Any]    						=			[
       '''BLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''BlipModel''',
       '''BlipPreTrainedModel''',
       '''BlipForConditionalGeneration''',
       '''BlipForQuestionAnswering''',
       '''BlipVisionModel''',
       '''BlipTextModel''',
       '''BlipForImageTextRetrieval''',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A				:					Union[str, Any]    						=			[
       '''TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''TFBlipModel''',
       '''TFBlipPreTrainedModel''',
       '''TFBlipForConditionalGeneration''',
       '''TFBlipForQuestionAnswering''',
       '''TFBlipVisionModel''',
       '''TFBlipTextModel''',
       '''TFBlipForImageTextRetrieval''',
   ]

if TYPE_CHECKING:
   from .configuration_blip import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipTextConfig, BlipVisionConfig
   from .processing_blip import BlipProcessor

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_blip import BlipImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_blip import (
          BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
          BlipForConditionalGeneration,
          BlipForImageTextRetrieval,
          BlipForQuestionAnswering,
          BlipModel,
          BlipPreTrainedModel,
          BlipTextModel,
          BlipVisionModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_blip import (
          TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFBlipForConditionalGeneration,
          TFBlipForImageTextRetrieval,
          TFBlipForQuestionAnswering,
          TFBlipModel,
          TFBlipPreTrainedModel,
          TFBlipTextModel,
          TFBlipVisionModel,
      )

else:
   import sys

   A				:					Optional[int]    						=			_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






