





import copy

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


UpperCAmelCase_							=				logging.get_logger(__name__)
class     UpperCamelCase__					(     lowerCamelCase__				):






		'''simple docstring'''






		__a       :       Tuple       =	"""encoder-decoder"""
		__a       :       Tuple       =	True






		def __init__(							self,   **snake_case__  )       -> Tuple:






									"""simple docstring"""
									super().__init__(**snake_case__  )
									assert (
									    "encoder" in kwargs and "decoder" in kwargs
									), "Config has to be initialized with encoder and decoder config"
									lowercase_	:   Optional[Any]  				=     kwargs.pop("""encoder"""  )
									lowercase_	:   List[str]  				=     encoder_config.pop("""model_type"""  )
									lowercase_	:   Optional[int]  				=     kwargs.pop("""decoder"""  )
									lowercase_	:   Optional[Any]  				=     decoder_config.pop("""model_type"""  )

									from ..auto.configuration_auto import AutoConfig

									lowercase_	:   int  				=     AutoConfig.for_model(snake_case__,   **snake_case__  )
									lowercase_	:   Union[str, Any]  				=     AutoConfig.for_model(snake_case__,   **snake_case__  )
									lowercase_	:   List[str]  				=     True






		@classmethod
		def 						snake_case__				(							cls,   snake_case__,   snake_case__,   **snake_case__  )       -> PretrainedConfig:






									"""simple docstring"""
									logger.info("""Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"""  )
									lowercase_	:   List[Any]  				=     True
									lowercase_	:   Optional[Any]  				=     True

									return cls(encoder=encoder_config.to_dict(),   decoder=decoder_config.to_dict(),   **snake_case__  )






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






									"""simple docstring"""
									lowercase_	:   str  				=     copy.deepcopy(self.__dict__  )
									lowercase_	:   Optional[Any]  				=     self.encoder.to_dict()
									lowercase_	:   Union[str, Any]  				=     self.decoder.to_dict()
									lowercase_	:   Dict  				=     self.__class__.model_type
									return output






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