




'''simple docstring'''







from typing import Callable, Optional

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


class     _a						(			__a				):
							def __init__(			self		:			List[Any]     ,       lowercase		:			Callable     ,       lowercase		:			Optional[Features] = None     ,       lowercase		:			str = None     ,       lowercase		:			bool = False     ,       lowercase		:			bool = False     ,       lowercase		:			Optional[dict] = None     ,       lowercase		:			Optional[int] = None     ,       **lowercase		:			str     ,       ):



											'''simple docstring'''

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







							def 					A   (			self		:			Optional[Any]       ):



											'''simple docstring'''

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

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










'''simple docstring'''







from ...configuration_utils import PretrainedConfig
from ...utils import logging


A									=logging.get_logger(__name__)

A									={
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}


class     _a						(			__a				):
       __a       :  List[Any]            =      """mgp-str"""
       def __init__(			self		:			str     ,       lowercase		:			str=[32, 128]     ,       lowercase		:			Optional[Any]=4     ,       lowercase		:			Optional[Any]=3     ,       lowercase		:			Dict=27     ,       lowercase		:			Any=38     ,       lowercase		:			int=50_257     ,       lowercase		:			List[str]=30_522     ,       lowercase		:			Optional[int]=768     ,       lowercase		:			List[Any]=12     ,       lowercase		:			Tuple=12     ,       lowercase		:			Optional[int]=4.0     ,       lowercase		:			Union[str, Any]=True     ,       lowercase		:			str=False     ,       lowercase		:			str=1E-5     ,       lowercase		:			Dict=0.0     ,       lowercase		:			Dict=0.0     ,       lowercase		:			Tuple=0.0     ,       lowercase		:			str=False     ,       lowercase		:			Optional[Any]=0.02     ,       **lowercase		:			List[str]     ,       ):



           '''simple docstring'''

           super().__init__(**lowercase       )

           UpperCAmelCase     =	image_size
           UpperCAmelCase     =	patch_size
           UpperCAmelCase     =	num_channels
           UpperCAmelCase     =	max_token_length
           UpperCAmelCase     =	num_character_labels
           UpperCAmelCase     =	num_bpe_labels
           UpperCAmelCase     =	num_wordpiece_labels
           UpperCAmelCase     =	hidden_size
           UpperCAmelCase     =	num_hidden_layers
           UpperCAmelCase     =	num_attention_heads
           UpperCAmelCase     =	mlp_ratio
           UpperCAmelCase     =	distilled
           UpperCAmelCase     =	layer_norm_eps
           UpperCAmelCase     =	drop_rate
           UpperCAmelCase     =	qkv_bias
           UpperCAmelCase     =	attn_drop_rate
           UpperCAmelCase     =	drop_path_rate
           UpperCAmelCase     =	output_aa_attentions
           UpperCAmelCase     =	initializer_range




