





"""simple docstring"""





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


lowerCAmelCase__     			=			logging.get_logger(__name__)

lowerCAmelCase__     			=			{
    '''google/pegasus-large''': '''https://huggingface.co/google/pegasus-large/resolve/main/config.json''',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}





class        _lowerCamelCase      (       _lowercase ):
						UpperCAmelCase_ =			"pegasus"
						UpperCAmelCase_ =			["past_key_values"]
						UpperCAmelCase_ =			{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}


						def __init__(self   ,							__a=5_02_65   ,							__a=10_24   ,							__a=12   ,							__a=40_96   ,							__a=16   ,							__a=12   ,							__a=40_96   ,							__a=16   ,							__a=0.0   ,							__a=0.0   ,							__a=True   ,							__a=True   ,							__a="gelu"   ,							__a=10_24   ,							__a=0.1   ,							__a=0.0   ,							__a=0.0   ,							__a=0.02   ,							__a=0   ,							__a=False   ,							__a=0   ,							__a=1   ,							__a=1   ,							**__a   ,							) ->   Tuple:
								UpperCamelCase   =	vocab_size
								UpperCamelCase   =	max_position_embeddings
								UpperCamelCase   =	d_model
								UpperCamelCase   =	encoder_ffn_dim
								UpperCamelCase   =	encoder_layers
								UpperCamelCase   =	encoder_attention_heads
								UpperCamelCase   =	decoder_ffn_dim
								UpperCamelCase   =	decoder_layers
								UpperCamelCase   =	decoder_attention_heads
								UpperCamelCase   =	dropout
								UpperCamelCase   =	attention_dropout
								UpperCamelCase   =	activation_dropout
								UpperCamelCase   =	activation_function
								UpperCamelCase   =	init_std
								UpperCamelCase   =	encoder_layerdrop
								UpperCamelCase   =	decoder_layerdrop
								UpperCamelCase   =	use_cache
								UpperCamelCase   =	encoder_layers
								UpperCamelCase   =	scale_embedding  # scale factor will be sqrt(d_model) if True
								super().__init__(
								    pad_token_id=__a   ,							eos_token_id=__a   ,							is_encoder_decoder=__a   ,							decoder_start_token_id=__a   ,							forced_eos_token_id=__a   ,							**__a   ,							)


						@property
						def     snake_case_   (self		) ->   int:
								return self.encoder_attention_heads




						@property
						def     snake_case_   (self		) ->   int:
								return self.d_model













"""simple docstring"""





import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


lowerCAmelCase__     			=			HUGGINGFACE_HUB_CACHE


lowerCAmelCase__     			=			'''config.json'''
lowerCAmelCase__     			=			'''diffusion_pytorch_model.bin'''
lowerCAmelCase__     			=			'''diffusion_flax_model.msgpack'''
lowerCAmelCase__     			=			'''model.onnx'''
lowerCAmelCase__     			=			'''diffusion_pytorch_model.safetensors'''
lowerCAmelCase__     			=			'''weights.pb'''
lowerCAmelCase__     			=			'''https://huggingface.co'''
lowerCAmelCase__     			=			default_cache_path
lowerCAmelCase__     			=			'''diffusers_modules'''
lowerCAmelCase__     			=			os.getenv('''HF_MODULES_CACHE''', os.path.join(hf_cache_home, '''modules'''))
lowerCAmelCase__     			=			['''fp16''', '''non-ema''']
lowerCAmelCase__     			=			'''.self_attn'''






