





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,   snake_case__,   snake_case__ = None,   snake_case__ = None,   snake_case__ = False,   snake_case__ = False,   snake_case__ = None,   snake_case__ = None,   **snake_case__,   )       -> Optional[Any]:






									"""simple docstring"""
									super().__init__(
									    features=snake_case__,   cache_dir=snake_case__,   keep_in_memory=snake_case__,   streaming=snake_case__,   num_proc=snake_case__,   **snake_case__,   )
									lowercase_	:   Tuple  				=     Generator(
									    cache_dir=snake_case__,   features=snake_case__,   generator=snake_case__,   gen_kwargs=snake_case__,   **snake_case__,   )






		def 						snake_case__				(							self  )       -> Optional[int]:






									"""simple docstring"""
									# Build iterable dataset
									if self.streaming:
																lowercase_	:   str  				=     self.builder.as_streaming_dataset(split="""train"""  )
									# Build regular (map-style) dataset
									else:
																lowercase_	:   Dict  				=     None
																lowercase_	:   Any  				=     None
																lowercase_	:   Optional[int]  				=     None
																lowercase_	:   int  				=     None

																self.builder.download_and_prepare(
																    download_config=snake_case__,   download_mode=snake_case__,   verification_mode=snake_case__,   base_path=snake_case__,   num_proc=self.num_proc,   )
																lowercase_	:   Any  				=     self.builder.as_dataset(
																    split="""train""",   verification_mode=snake_case__,   in_memory=self.keep_in_memory  )
									return dataset






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


UpperCAmelCase_							=				logging.get_logger(__name__)

UpperCAmelCase_							=				{
    """google/canine-s""": """https://huggingface.co/google/canine-s/resolve/main/config.json""",
    # See all CANINE models at https://huggingface.co/models?filter=canine
}
class     UpperCamelCase__					(     lowerCamelCase__				):






		'''simple docstring'''






		__a       :       Optional[int]       =	"""canine"""






		def __init__(							self,   snake_case__=7_68,   snake_case__=12,   snake_case__=12,   snake_case__=30_72,   snake_case__="gelu",   snake_case__=0.1,   snake_case__=0.1,   snake_case__=1_63_84,   snake_case__=16,   snake_case__=0.02,   snake_case__=1E-12,   snake_case__=0,   snake_case__=0XE_0_0_0,   snake_case__=0XE_0_0_1,   snake_case__=4,   snake_case__=4,   snake_case__=8,   snake_case__=1_63_84,   snake_case__=1_28,   **snake_case__,   )       -> Optional[int]:






									"""simple docstring"""
									super().__init__(pad_token_id=snake_case__,   bos_token_id=snake_case__,   eos_token_id=snake_case__,   **snake_case__  )

									lowercase_	:   int  				=     max_position_embeddings
									lowercase_	:   Union[str, Any]  				=     hidden_size
									lowercase_	:   Optional[Any]  				=     num_hidden_layers
									lowercase_	:   str  				=     num_attention_heads
									lowercase_	:   List[Any]  				=     intermediate_size
									lowercase_	:   Optional[Any]  				=     hidden_act
									lowercase_	:   List[str]  				=     hidden_dropout_prob
									lowercase_	:   Any  				=     attention_probs_dropout_prob
									lowercase_	:   Union[str, Any]  				=     initializer_range
									lowercase_	:   Optional[Any]  				=     type_vocab_size
									lowercase_	:   Dict  				=     layer_norm_eps

									# Character config:
									lowercase_	:   Optional[int]  				=     downsampling_rate
									lowercase_	:   List[str]  				=     upsampling_kernel_size
									lowercase_	:   int  				=     num_hash_functions
									lowercase_	:   List[str]  				=     num_hash_buckets
									lowercase_	:   List[str]  				=     local_transformer_stride