

from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


__A			:					Tuple						=			{
    'susnato/ernie-m-base_pytorch': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json',
    'susnato/ernie-m-large_pytorch': 'https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json',
}





class 			_SCREAMING_SNAKE_CASE (   _lowerCamelCase		):







   '''simple docstring'''




   lowerCamelCase__				=      'ernie_m'
   lowerCamelCase__				=      {"dropout": "classifier_dropout", "num_classes": "num_labels"}





   def __init__(       self					:			Tuple     , __lowerCamelCase					:			int = 250002     , __lowerCamelCase					:			int = 768     , __lowerCamelCase					:			int = 12     , __lowerCamelCase					:			int = 12     , __lowerCamelCase					:			int = 3072     , __lowerCamelCase					:			str = "gelu"     , __lowerCamelCase					:			float = 0.1     , __lowerCamelCase					:			float = 0.1     , __lowerCamelCase					:			int = 514     , __lowerCamelCase					:			float = 0.02     , __lowerCamelCase					:			int = 1     , __lowerCamelCase					:			float = 1e-05     , __lowerCamelCase					:			Union[str, Any]=None     , __lowerCamelCase					:			Optional[int]=False     , __lowerCamelCase					:			int=0.0     , **__lowerCamelCase					:			Optional[int]     , ):
       super().__init__(pad_token_id=__UpperCamelCase     , **__UpperCamelCase			)
       SCREAMING_SNAKE_CASE										=   vocab_size
       SCREAMING_SNAKE_CASE										=   hidden_size
       SCREAMING_SNAKE_CASE										=   num_hidden_layers
       SCREAMING_SNAKE_CASE										=   num_attention_heads
       SCREAMING_SNAKE_CASE										=   intermediate_size
       SCREAMING_SNAKE_CASE										=   hidden_act
       SCREAMING_SNAKE_CASE										=   hidden_dropout_prob
       SCREAMING_SNAKE_CASE										=   attention_probs_dropout_prob
       SCREAMING_SNAKE_CASE										=   max_position_embeddings
       SCREAMING_SNAKE_CASE										=   initializer_range
       SCREAMING_SNAKE_CASE										=   layer_norm_eps
       SCREAMING_SNAKE_CASE										=   classifier_dropout
       SCREAMING_SNAKE_CASE										=   is_decoder
       SCREAMING_SNAKE_CASE										=   act_dropout




from typing import Callable, Optional

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



class        lowerCAmelCase__					(  _lowerCamelCase       ):


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


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

																		self.builder.download_and_prepare(
																		    download_config=__UpperCamelCase						, download_mode=__UpperCamelCase						, verification_mode=__UpperCamelCase						, base_path=__UpperCamelCase						, num_proc=self.num_proc						, )
																		A      						=    self.builder.as_dataset(
																		    split='train'						, verification_mode=__UpperCamelCase						, in_memory=self.keep_in_memory       )
											return dataset