




import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible





class 			lowerCamelCase_				( unittest.TestCase   ):


 '''simple docstring'''







 def  lowerCAmelCase_    (				self    :						Optional[int]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.bin',
           'safety_checker/model.safetensors',
           'vae/diffusion_pytorch_model.bin',
           'vae/diffusion_pytorch_model.safetensors',
           'text_encoder/pytorch_model.bin',
           'text_encoder/model.safetensors',
           'unet/diffusion_pytorch_model.bin',
           'unet/diffusion_pytorch_model.safetensors',
       ]
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						List[str]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'unet/diffusion_pytorch_model.bin',
           'unet/diffusion_pytorch_model.safetensors',
       ]
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Union[str, Any]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.bin',
           'safety_checker/model.safetensors',
           'vae/diffusion_pytorch_model.bin',
           'vae/diffusion_pytorch_model.safetensors',
           'text_encoder/pytorch_model.bin',
           'text_encoder/model.safetensors',
           'unet/diffusion_pytorch_model.bin',
           # Removed: 'unet/diffusion_pytorch_model.safetensors',
       ]
       self.assertFalse(is_safetensors_compatible(_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Any		):
       SCREAMING_SNAKE_CASE_      		=     [
           'text_encoder/pytorch_model.bin',
           'text_encoder/model.safetensors',
       ]
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						List[str]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.bin',
           'safety_checker/model.safetensors',
           'vae/diffusion_pytorch_model.bin',
           'vae/diffusion_pytorch_model.safetensors',
           'text_encoder/pytorch_model.bin',
           # Removed: 'text_encoder/model.safetensors',
           'unet/diffusion_pytorch_model.bin',
           'unet/diffusion_pytorch_model.safetensors',
       ]
       self.assertFalse(is_safetensors_compatible(_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Optional[Any]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.fp16.bin',
           'safety_checker/model.fp16.safetensors',
           'vae/diffusion_pytorch_model.fp16.bin',
           'vae/diffusion_pytorch_model.fp16.safetensors',
           'text_encoder/pytorch_model.fp16.bin',
           'text_encoder/model.fp16.safetensors',
           'unet/diffusion_pytorch_model.fp16.bin',
           'unet/diffusion_pytorch_model.fp16.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Dict		):
       SCREAMING_SNAKE_CASE_      		=     [
           'unet/diffusion_pytorch_model.fp16.bin',
           'unet/diffusion_pytorch_model.fp16.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Tuple		):
       # pass variant but use the non-variant filenames
       SCREAMING_SNAKE_CASE_      		=     [
           'unet/diffusion_pytorch_model.bin',
           'unet/diffusion_pytorch_model.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						List[str]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.fp16.bin',
           'safety_checker/model.fp16.safetensors',
           'vae/diffusion_pytorch_model.fp16.bin',
           'vae/diffusion_pytorch_model.fp16.safetensors',
           'text_encoder/pytorch_model.fp16.bin',
           'text_encoder/model.fp16.safetensors',
           'unet/diffusion_pytorch_model.fp16.bin',
           # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertFalse(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						Tuple		):
       SCREAMING_SNAKE_CASE_      		=     [
           'text_encoder/pytorch_model.fp16.bin',
           'text_encoder/model.fp16.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)



 def  lowerCAmelCase_    (				self    :						int		):
       # pass variant but use the non-variant filenames
       SCREAMING_SNAKE_CASE_      		=     [
           'text_encoder/pytorch_model.bin',
           'text_encoder/model.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertTrue(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)




 def  lowerCAmelCase_    (				self    :						Optional[int]		):
       SCREAMING_SNAKE_CASE_      		=     [
           'safety_checker/pytorch_model.fp16.bin',
           'safety_checker/model.fp16.safetensors',
           'vae/diffusion_pytorch_model.fp16.bin',
           'vae/diffusion_pytorch_model.fp16.safetensors',
           'text_encoder/pytorch_model.fp16.bin',
           # 'text_encoder/model.fp16.safetensors',
           'unet/diffusion_pytorch_model.fp16.bin',
           'unet/diffusion_pytorch_model.fp16.safetensors',
       ]
       SCREAMING_SNAKE_CASE_      		=     'fp16'
       self.assertFalse(is_safetensors_compatible(_lowerCAmelCase							,							variant=_lowerCAmelCase		)		)




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


a_								=       logging.get_logger(__name__)

a_								=       {
    """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 			__lowerCAmelCase  (						lowerCAmelCase__ ):
 lowerCAmelCase__							       =	"""canine"""




 def __init__(    self						,					__UpperCAmelCase=768						,					__UpperCAmelCase=12						,					__UpperCAmelCase=12						,					__UpperCAmelCase=3072						,					__UpperCAmelCase="gelu"						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=16384						,					__UpperCAmelCase=16						,					__UpperCAmelCase=0.02						,					__UpperCAmelCase=1E-1_2						,					__UpperCAmelCase=0						,					__UpperCAmelCase=0Xe_000						,					__UpperCAmelCase=0Xe_001						,					__UpperCAmelCase=4						,					__UpperCAmelCase=4						,					__UpperCAmelCase=8						,					__UpperCAmelCase=16384						,					__UpperCAmelCase=128						,					**__UpperCAmelCase						,					):



    '''simple docstring'''
    super().__init__(pad_token_id=__UpperCAmelCase						,					bos_token_id=__UpperCAmelCase						,					eos_token_id=__UpperCAmelCase						,					**__UpperCAmelCase					)

    __lowerCamelCase    				=     max_position_embeddings
    __lowerCamelCase    				=     hidden_size
    __lowerCamelCase    				=     num_hidden_layers
    __lowerCamelCase    				=     num_attention_heads
    __lowerCamelCase    				=     intermediate_size
    __lowerCamelCase    				=     hidden_act
    __lowerCamelCase    				=     hidden_dropout_prob
    __lowerCamelCase    				=     attention_probs_dropout_prob
    __lowerCamelCase    				=     initializer_range
    __lowerCamelCase    				=     type_vocab_size
    __lowerCamelCase    				=     layer_norm_eps

    # Character config:
    __lowerCamelCase    				=     downsampling_rate
    __lowerCamelCase    				=     upsampling_kernel_size
    __lowerCamelCase    				=     num_hash_functions
    __lowerCamelCase    				=     num_hash_buckets
    __lowerCamelCase    				=     local_transformer_stride






