





import collections.abc
from typing import Optional, Tuple, Union

import torch
import torch.utils.checkpoint
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss

from ...activations import ACTaFN
from ...modeling_outputs import BaseModelOutputWithNoAttention, ImageClassifierOutputWithNoAttention
from ...modeling_utils import PreTrainedModel
from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
from .configuration_poolformer import PoolFormerConfig


SCREAMING_SNAKE_CASE_						   =       logging.get_logger(__name__)

# General docstring
SCREAMING_SNAKE_CASE_						   =       """PoolFormerConfig"""

# Base docstring
SCREAMING_SNAKE_CASE_						   =       """sail/poolformer_s12"""
SCREAMING_SNAKE_CASE_						   =       [1, 5_1_2, 7, 7]

# Image classification docstring
SCREAMING_SNAKE_CASE_						   =       """sail/poolformer_s12"""
SCREAMING_SNAKE_CASE_						   =       """tabby, tabby cat"""

SCREAMING_SNAKE_CASE_						   =       [
    """sail/poolformer_s12""",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
]



def    __lowercase   (      _SCREAMING_SNAKE_CASE ,						_SCREAMING_SNAKE_CASE = 0.0 ,						_SCREAMING_SNAKE_CASE = False	) ->   Optional[int]:


      '''simple docstring'''


      if drop_prob == 0.0 or not training:
            return input
      SCREAMING_SNAKE_CASE		=						1 - drop_prob
      SCREAMING_SNAKE_CASE		=						(input.shape[0],) + (1,) * (input.ndim - 1)  # work with diff dim tensors, not just 2D ConvNets
      SCREAMING_SNAKE_CASE		=						keep_prob + torch.rand(_SCREAMING_SNAKE_CASE ,						dtype=input.dtype ,						device=input.device	)
      random_tensor.floor_()  # binarize
      SCREAMING_SNAKE_CASE		=						input.div(_SCREAMING_SNAKE_CASE	) * random_tensor
      return output

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    Dict						,lowerCamelCase__						:    Optional[float] = None       )     ->		None:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						drop_prob






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Optional[Any]						,lowerCamelCase__						:    torch.Tensor       )     ->		torch.Tensor:




           '''simple docstring'''


           return drop_path(lowerCamelCase__						,self.drop_prob						,self.training       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    List[Any]       )     ->		str:




           '''simple docstring'''


           return "p={}".format(self.drop_prob       )

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    List[Any]						,lowerCamelCase__						:    List[Any]						,lowerCamelCase__						:    str						,lowerCamelCase__						:    Optional[Any]						,lowerCamelCase__						:    Dict						,lowerCamelCase__						:    Any						,lowerCamelCase__						:    str=None       )     ->		Tuple:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						patch_size if isinstance(lowerCamelCase__						,collections.abc.Iterable       ) else (patch_size, patch_size)
           SCREAMING_SNAKE_CASE		=						stride if isinstance(lowerCamelCase__						,collections.abc.Iterable       ) else (stride, stride)
           SCREAMING_SNAKE_CASE		=						padding if isinstance(lowerCamelCase__						,collections.abc.Iterable       ) else (padding, padding)

           SCREAMING_SNAKE_CASE		=						nn.Convad(lowerCamelCase__						,lowerCamelCase__						,kernel_size=lowerCamelCase__						,stride=lowerCamelCase__						,padding=lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						norm_layer(lowerCamelCase__       ) if norm_layer else nn.Identity()






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Union[str, Any]						,lowerCamelCase__						:    Optional[Any]       )     ->		Optional[int]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						self.projection(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						self.norm(lowerCamelCase__       )
           return embeddings

class 		UpperCamelCase__ (      nn.GroupNorm   ):



     '''simple docstring'''

     def __init__(							self						:    Optional[int]						,lowerCamelCase__						:    int						,**lowerCamelCase__						:    Union[str, Any]       )     ->		Dict:




           '''simple docstring'''


           super().__init__(1						,lowerCamelCase__						,**lowerCamelCase__       )

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    Any						,lowerCamelCase__						:    Union[str, Any]       )     ->		List[Any]:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						nn.AvgPoolad(lowerCamelCase__						,stride=1						,padding=pool_size // 2						,count_include_pad=lowerCamelCase__       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Tuple						,lowerCamelCase__						:    Optional[int]       )     ->		Tuple:




           '''simple docstring'''


           return self.pool(lowerCamelCase__       ) - hidden_states

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    List[str]						,lowerCamelCase__						:    Optional[int]						,lowerCamelCase__						:    int						,lowerCamelCase__						:    Tuple						,lowerCamelCase__						:    Optional[int]       )     ->		List[str]:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						nn.Convad(lowerCamelCase__						,lowerCamelCase__						,1       )
           SCREAMING_SNAKE_CASE		=						nn.Convad(lowerCamelCase__						,lowerCamelCase__						,1       )
           SCREAMING_SNAKE_CASE		=						PoolFormerDropPath(lowerCamelCase__       )
           if isinstance(config.hidden_act						,lowerCamelCase__       ):
                 SCREAMING_SNAKE_CASE		=						ACTaFN[config.hidden_act]
           else:
                 SCREAMING_SNAKE_CASE		=						config.hidden_act






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Optional[Any]						,lowerCamelCase__						:    int       )     ->		int:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						self.conva(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						self.act_fn(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						self.drop(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						self.conva(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						self.drop(lowerCamelCase__       )

           return hidden_states

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    List[Any]						,lowerCamelCase__						:    Dict						,lowerCamelCase__						:    List[Any]						,lowerCamelCase__						:    int						,lowerCamelCase__						:    List[Any]						,lowerCamelCase__						:    List[Any]						,lowerCamelCase__						:    Dict       )     ->		Optional[Any]:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						PoolFormerPooling(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						PoolFormerOutput(lowerCamelCase__						,lowerCamelCase__						,lowerCamelCase__						,lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						PoolFormerGroupNorm(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						PoolFormerGroupNorm(lowerCamelCase__       )

           # Useful for training neural nets
           SCREAMING_SNAKE_CASE		=						PoolFormerDropPath(lowerCamelCase__       ) if drop_path > 0.0 else nn.Identity()
           SCREAMING_SNAKE_CASE		=						config.use_layer_scale
           if config.use_layer_scale:
                 SCREAMING_SNAKE_CASE		=						nn.Parameter(
                     config.layer_scale_init_value * torch.ones((lowerCamelCase__)       )						,requires_grad=lowerCamelCase__       )
                 SCREAMING_SNAKE_CASE		=						nn.Parameter(
                     config.layer_scale_init_value * torch.ones((lowerCamelCase__)       )						,requires_grad=lowerCamelCase__       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    List[str]						,lowerCamelCase__						:    List[str]       )     ->		str:




           '''simple docstring'''


           if self.use_layer_scale:
                 SCREAMING_SNAKE_CASE		=						self.pooling(self.before_norm(lowerCamelCase__       )       )
                 SCREAMING_SNAKE_CASE		=						self.layer_scale_a.unsqueeze(-1       ).unsqueeze(-1       ) * pooling_output
                 # First residual connection
                 SCREAMING_SNAKE_CASE		=						hidden_states + self.drop_path(lowerCamelCase__       )
                 SCREAMING_SNAKE_CASE		=						()

                 SCREAMING_SNAKE_CASE		=						self.output(self.after_norm(lowerCamelCase__       )       )
                 SCREAMING_SNAKE_CASE		=						self.layer_scale_a.unsqueeze(-1       ).unsqueeze(-1       ) * layer_output
                 # Second residual connection
                 SCREAMING_SNAKE_CASE		=						hidden_states + self.drop_path(lowerCamelCase__       )

                 SCREAMING_SNAKE_CASE		=						(output,) + outputs
                 return outputs

           else:
                 SCREAMING_SNAKE_CASE		=						self.drop_path(self.pooling(self.before_norm(lowerCamelCase__       )       )       )
                 # First residual connection
                 SCREAMING_SNAKE_CASE		=						pooling_output + hidden_states
                 SCREAMING_SNAKE_CASE		=						()

                 # Second residual connection inside the PoolFormerOutput block
                 SCREAMING_SNAKE_CASE		=						self.drop_path(self.output(self.after_norm(lowerCamelCase__       )       )       )
                 SCREAMING_SNAKE_CASE		=						hidden_states + layer_output

                 SCREAMING_SNAKE_CASE		=						(output,) + outputs
                 return outputs

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    Optional[Any]						,lowerCamelCase__						:    Union[str, Any]       )     ->		str:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						config
           # stochastic depth decay rule
           SCREAMING_SNAKE_CASE		=						[x.item() for x in torch.linspace(0						,config.drop_path_rate						,sum(config.depths       )       )]

           # patch embeddings
           SCREAMING_SNAKE_CASE		=						[]
           for i in range(config.num_encoder_blocks       ):
                 embeddings.append(
                     PoolFormerEmbeddings(
                         patch_size=config.patch_sizes[i]						,stride=config.strides[i]						,padding=config.padding[i]						,num_channels=config.num_channels if i == 0 else config.hidden_sizes[i - 1]						,hidden_size=config.hidden_sizes[i]						,)       )
           SCREAMING_SNAKE_CASE		=						nn.ModuleList(lowerCamelCase__       )

           # Transformer blocks
           SCREAMING_SNAKE_CASE		=						[]
           SCREAMING_SNAKE_CASE		=						0
           for i in range(config.num_encoder_blocks       ):
                 # each block consists of layers
                 SCREAMING_SNAKE_CASE		=						[]
                 if i != 0:
                       cur += config.depths[i - 1]
                 for j in range(config.depths[i]       ):
                       layers.append(
                           PoolFormerLayer(
                               lowerCamelCase__						,num_channels=config.hidden_sizes[i]						,pool_size=config.pool_size						,hidden_size=config.hidden_sizes[i]						,intermediate_size=int(config.hidden_sizes[i] * config.mlp_ratio       )						,drop_path=dpr[cur + j]						,)       )
                 blocks.append(nn.ModuleList(lowerCamelCase__       )       )

           SCREAMING_SNAKE_CASE		=						nn.ModuleList(lowerCamelCase__       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Optional[int]						,lowerCamelCase__						:    int						,lowerCamelCase__						:    int=False						,lowerCamelCase__						:    Optional[int]=True       )     ->		List[str]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						() if output_hidden_states else None

           SCREAMING_SNAKE_CASE		=						pixel_values
           for idx, layers in enumerate(zip(self.patch_embeddings						,self.block       )       ):
                 SCREAMING_SNAKE_CASE,					SCREAMING_SNAKE_CASE		=						layers
                 # Get patch embeddings from hidden_states
                 SCREAMING_SNAKE_CASE		=						embedding_layer(lowerCamelCase__       )
                 # Send the embeddings through the blocks
                 for _, blk in enumerate(lowerCamelCase__       ):
                       SCREAMING_SNAKE_CASE		=						blk(lowerCamelCase__       )
                       SCREAMING_SNAKE_CASE		=						layer_outputs[0]

                 if output_hidden_states:
                       SCREAMING_SNAKE_CASE		=						all_hidden_states + (hidden_states,)

           if not return_dict:
                 return tuple(v for v in [hidden_states, all_hidden_states] if v is not None       )

           return BaseModelOutputWithNoAttention(last_hidden_state=lowerCamelCase__						,hidden_states=lowerCamelCase__       )

class 		UpperCamelCase__ (      lowerCAmelCase_   ):



     '''simple docstring'''

     __snake_case    :	Dict			=			PoolFormerConfig
     __snake_case    :	str			=			"poolformer"
     __snake_case    :	Union[str, Any]			=			"pixel_values"
     __snake_case    :	str			=			True






     def 				SCREAMING_SNAKE_CASE__  (							self						:    List[Any]						,lowerCamelCase__						:    str       )     ->		Optional[int]:




           '''simple docstring'''


           if isinstance(lowerCamelCase__						,(nn.Linear, nn.Convad)       ):
                 module.weight.data.normal_(mean=0.0						,std=self.config.initializer_range       )
                 if module.bias is not None:
                       module.bias.data.zero_()
           elif isinstance(lowerCamelCase__						,nn.LayerNorm       ):
                 module.bias.data.zero_()
                 module.weight.data.fill_(1.0       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Optional[Any]						,lowerCamelCase__						:    Any						,lowerCamelCase__						:    Any=False       )     ->		Union[str, Any]:




           '''simple docstring'''


           if isinstance(lowerCamelCase__						,lowerCamelCase__       ):
                 SCREAMING_SNAKE_CASE		=						value
SCREAMING_SNAKE_CASE_						   =       r"""
    This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
    it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
    behavior.

    Parameters:
        config ([`PoolFormerConfig`]): Model configuration class with all the parameters of the model.
            Initializing with a config file does not load the weights associated with the model, only the
            configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
"""

SCREAMING_SNAKE_CASE_						   =       r"""
    Args:
        pixel_values (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):
            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See
            [`PoolFormerImageProcessor.__call__`] for details.
"""

@add_start_docstrings(
    "The bare PoolFormer Model transformer outputting raw hidden-states without any specific head on top."							,      lowerCAmelCase_							,      )
class 		UpperCamelCase__ (      lowerCAmelCase_   ):



     '''simple docstring'''

     def __init__(							self						:    List[Any]						,lowerCamelCase__						:    str       )     ->		Dict:




           '''simple docstring'''


           super().__init__(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						config

           SCREAMING_SNAKE_CASE		=						PoolFormerEncoder(lowerCamelCase__       )

           # Initialize weights and apply final processing
           self.post_init()






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Union[str, Any]       )     ->		str:




           '''simple docstring'''


           return self.embeddings.patch_embeddings






     @add_start_docstrings_to_model_forward(lowerCamelCase__       )
     @add_code_sample_docstrings(
         checkpoint=_CHECKPOINT_FOR_DOC						,output_type=lowerCamelCase__						,config_class=_CONFIG_FOR_DOC						,modality="""vision"""						,expected_output=_EXPECTED_OUTPUT_SHAPE						,)
     def 				SCREAMING_SNAKE_CASE__  (							self						:    List[Any]						,lowerCamelCase__						:    Optional[torch.FloatTensor] = None						,lowerCamelCase__						:    Optional[bool] = None						,lowerCamelCase__						:    Optional[bool] = None						,)     ->		Union[Tuple, BaseModelOutputWithNoAttention]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						(
               output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
           )
           SCREAMING_SNAKE_CASE		=						return_dict if return_dict is not None else self.config.use_return_dict

           if pixel_values is None:
                 raise ValueError("""You have to specify pixel_values"""       )

           SCREAMING_SNAKE_CASE		=						self.encoder(
               lowerCamelCase__						,output_hidden_states=lowerCamelCase__						,return_dict=lowerCamelCase__						,)
           SCREAMING_SNAKE_CASE		=						encoder_outputs[0]

           if not return_dict:
                 return (sequence_output, None) + encoder_outputs[1:]

           return BaseModelOutputWithNoAttention(
               last_hidden_state=lowerCamelCase__						,hidden_states=encoder_outputs.hidden_states						,)

class 		UpperCamelCase__ (      nn.Module   ):



     '''simple docstring'''

     def __init__(							self						:    Dict						,lowerCamelCase__						:    int       )     ->		int:




           '''simple docstring'''


           super().__init__()
           SCREAMING_SNAKE_CASE		=						nn.Linear(config.hidden_size						,config.hidden_size       )






     def 				SCREAMING_SNAKE_CASE__  (							self						:    List[Any]						,lowerCamelCase__						:    List[Any]       )     ->		int:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						self.dense(lowerCamelCase__       )
           return output

@add_start_docstrings(
    "\n    PoolFormer Model transformer with an image classification head on top\n    "							,      lowerCAmelCase_							,      )
class 		UpperCamelCase__ (      lowerCAmelCase_   ):



     '''simple docstring'''

     def __init__(							self						:    List[Any]						,lowerCamelCase__						:    str       )     ->		Any:




           '''simple docstring'''


           super().__init__(lowerCamelCase__       )
           SCREAMING_SNAKE_CASE		=						config.num_labels
           SCREAMING_SNAKE_CASE		=						PoolFormerModel(lowerCamelCase__       )

           # Final norm
           SCREAMING_SNAKE_CASE		=						PoolFormerGroupNorm(config.hidden_sizes[-1]       )
           # Classifier head
           SCREAMING_SNAKE_CASE		=						(
               nn.Linear(config.hidden_sizes[-1]						,config.num_labels       ) if config.num_labels > 0 else nn.Identity()
           )

           # Initialize weights and apply final processing
           self.post_init()






     @add_start_docstrings_to_model_forward(lowerCamelCase__       )
     @add_code_sample_docstrings(
         checkpoint=_IMAGE_CLASS_CHECKPOINT						,output_type=lowerCamelCase__						,config_class=_CONFIG_FOR_DOC						,expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT						,)
     def 				SCREAMING_SNAKE_CASE__  (							self						:    str						,lowerCamelCase__						:    Optional[torch.FloatTensor] = None						,lowerCamelCase__						:    Optional[torch.LongTensor] = None						,lowerCamelCase__						:    Optional[bool] = None						,lowerCamelCase__						:    Optional[bool] = None						,)     ->		Union[Tuple, ImageClassifierOutputWithNoAttention]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						return_dict if return_dict is not None else self.config.use_return_dict

           SCREAMING_SNAKE_CASE		=						self.poolformer(
               lowerCamelCase__						,output_hidden_states=lowerCamelCase__						,return_dict=lowerCamelCase__						,)

           SCREAMING_SNAKE_CASE		=						outputs[0]

           SCREAMING_SNAKE_CASE		=						self.classifier(self.norm(lowerCamelCase__       ).mean([-2, -1]       )       )

           SCREAMING_SNAKE_CASE		=						None
           if labels is not None:
                 if self.config.problem_type is None:
                       if self.num_labels == 1:
                             SCREAMING_SNAKE_CASE		=						"""regression"""
                       elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
                             SCREAMING_SNAKE_CASE		=						"""single_label_classification"""
                       else:
                             SCREAMING_SNAKE_CASE		=						"""multi_label_classification"""

                 if self.config.problem_type == "regression":
                       SCREAMING_SNAKE_CASE		=						MSELoss()
                       if self.num_labels == 1:
                             SCREAMING_SNAKE_CASE		=						loss_fct(logits.squeeze()						,labels.squeeze()       )
                       else:
                             SCREAMING_SNAKE_CASE		=						loss_fct(lowerCamelCase__						,lowerCamelCase__       )
                 elif self.config.problem_type == "single_label_classification":
                       SCREAMING_SNAKE_CASE		=						CrossEntropyLoss()
                       SCREAMING_SNAKE_CASE		=						loss_fct(logits.view(-1						,self.num_labels       )						,labels.view(-1       )       )
                 elif self.config.problem_type == "multi_label_classification":
                       SCREAMING_SNAKE_CASE		=						BCEWithLogitsLoss()
                       SCREAMING_SNAKE_CASE		=						loss_fct(lowerCamelCase__						,lowerCamelCase__       )

           if not return_dict:
                 SCREAMING_SNAKE_CASE		=						(logits,) + outputs[2:]
                 return ((loss,) + output) if loss is not None else output

           return ImageClassifierOutputWithNoAttention(loss=lowerCamelCase__						,logits=lowerCamelCase__						,hidden_states=outputs.hidden_states       )









from typing import Callable, Optional

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

class 		UpperCamelCase__ (      lowerCAmelCase_   ):



     '''simple docstring'''

     def __init__(							self						:    Union[str, Any]						,lowerCamelCase__						:    Callable						,lowerCamelCase__						:    Optional[Features] = None						,lowerCamelCase__						:    str = None						,lowerCamelCase__						:    bool = False						,lowerCamelCase__						:    bool = False						,lowerCamelCase__						:    Optional[dict] = None						,lowerCamelCase__						:    Optional[int] = None						,**lowerCamelCase__						:    Optional[Any]						,)     ->		List[str]:




           '''simple docstring'''


           super().__init__(
               features=lowerCamelCase__						,cache_dir=lowerCamelCase__						,keep_in_memory=lowerCamelCase__						,streaming=lowerCamelCase__						,num_proc=lowerCamelCase__						,**lowerCamelCase__						,)
           SCREAMING_SNAKE_CASE		=						Generator(
               cache_dir=lowerCamelCase__						,features=lowerCamelCase__						,generator=lowerCamelCase__						,gen_kwargs=lowerCamelCase__						,**lowerCamelCase__						,)






     def 				SCREAMING_SNAKE_CASE__  (							self						:    Union[str, Any]       )     ->		Optional[Any]:




           '''simple docstring'''


           if self.streaming:
                 SCREAMING_SNAKE_CASE		=						self.builder.as_streaming_dataset(split="""train"""       )
           # Build regular (map-style) dataset
           else:
                 SCREAMING_SNAKE_CASE		=						None
                 SCREAMING_SNAKE_CASE		=						None
                 SCREAMING_SNAKE_CASE		=						None
                 SCREAMING_SNAKE_CASE		=						None

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


