


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


UpperCAmelCase_   :				int						      = logging.get_logger(__name__)

UpperCAmelCase_   :				Optional[int]						      = {
    '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 				SCREAMING_SNAKE_CASE__						(       _a    ):
      snake_case__       :  Tuple       =	'''canine'''
      def __init__( self       : Union[str, Any]  ,							SCREAMING_SNAKE_CASE__       : int=7_6_8  ,							SCREAMING_SNAKE_CASE__       : int=1_2  ,							SCREAMING_SNAKE_CASE__       : Dict=1_2  ,							SCREAMING_SNAKE_CASE__       : List[str]=3_0_7_2  ,							SCREAMING_SNAKE_CASE__       : Union[str, Any]="gelu"  ,							SCREAMING_SNAKE_CASE__       : List[str]=0.1  ,							SCREAMING_SNAKE_CASE__       : Tuple=0.1  ,							SCREAMING_SNAKE_CASE__       : List[Any]=1_6_3_8_4  ,							SCREAMING_SNAKE_CASE__       : str=1_6  ,							SCREAMING_SNAKE_CASE__       : Tuple=0.02  ,							SCREAMING_SNAKE_CASE__       : int=1E-12  ,							SCREAMING_SNAKE_CASE__       : int=0  ,							SCREAMING_SNAKE_CASE__       : Optional[int]=0Xe000  ,							SCREAMING_SNAKE_CASE__       : Any=0Xe001  ,							SCREAMING_SNAKE_CASE__       : int=4  ,							SCREAMING_SNAKE_CASE__       : int=4  ,							SCREAMING_SNAKE_CASE__       : Dict=8  ,							SCREAMING_SNAKE_CASE__       : str=1_6_3_8_4  ,							SCREAMING_SNAKE_CASE__       : Any=1_2_8  ,							**SCREAMING_SNAKE_CASE__       : int  ,							)	->    Optional[Any]:
             super().__init__(pad_token_id=_A  ,							bos_token_id=_A  ,							eos_token_id=_A  ,							**_A  )

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

             # Character config:
             a_      :	Dict							=						downsampling_rate
             a_      :	Optional[int]							=						upsampling_kernel_size
             a_      :	List[Any]							=						num_hash_functions
             a_      :	Tuple							=						num_hash_buckets
             a_      :	List[Any]							=						local_transformer_stride






import os
import tempfile
import unittest

from transformers.models.marian.convert_marian_tatoeba_to_pytorch import DEFAULT_REPO, TatoebaConverter
from transformers.testing_utils import slow
from transformers.utils import cached_property
@unittest.skipUnless(os.path.exists(lowercase__    )		,					'''Tatoeba directory does not exist.'''    )
class 				SCREAMING_SNAKE_CASE__						(       unittest.TestCase    ):
      @cached_property
      def  SCREAMING_SNAKE_CASE							( self       : str  )	->    List[Any]:
             a_      :	Optional[Any]							=						tempfile.mkdtemp()
             return TatoebaConverter(save_dir=SCREAMING_SNAKE_CASE__  )
      @slow
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  )	->    Optional[Any]:
             self.resolver.convert_models(['heb-eng']  )

      @slow
      def  SCREAMING_SNAKE_CASE							( self       : int  )	->    Any:
             a_							,	a_      :	Dict							=						self.resolver.write_model_card('opus-mt-he-en'  ,							dry_run=SCREAMING_SNAKE_CASE__  )
             assert mmeta["long_pair"] == "heb-eng"


