


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


A :	Optional[int]												=     logging.get_logger(__name__)

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



class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					A__    =				'''pegasus_x'''
					A__    =				['''past_key_values''']
					A__    =				{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}

					def __init__(self					:		Union[str, Any]   ,      _UpperCAmelCase					:		List[str]=9_6103   ,      _UpperCAmelCase					:		Union[str, Any]=1_6384   ,      _UpperCAmelCase					:		Optional[int]=16   ,      _UpperCAmelCase					:		int=4096   ,      _UpperCAmelCase					:		Optional[Any]=16   ,      _UpperCAmelCase					:		Dict=16   ,      _UpperCAmelCase					:		Optional[int]=4096   ,      _UpperCAmelCase					:		List[str]=16   ,      _UpperCAmelCase					:		Optional[Any]=0.0   ,      _UpperCAmelCase					:		Tuple=0.0   ,      _UpperCAmelCase					:		Tuple=True   ,      _UpperCAmelCase					:		Tuple=True   ,      _UpperCAmelCase					:		List[Any]="gelu"   ,      _UpperCAmelCase					:		str=1024   ,      _UpperCAmelCase					:		int=0.1   ,      _UpperCAmelCase					:		str=0.0   ,      _UpperCAmelCase					:		Tuple=0.0   ,      _UpperCAmelCase					:		Tuple=0.02   ,      _UpperCAmelCase					:		int=0   ,      _UpperCAmelCase					:		int=True   ,      _UpperCAmelCase					:		List[Any]=0   ,      _UpperCAmelCase					:		Optional[Any]=1   ,      _UpperCAmelCase					:		Optional[int]=1   ,      _UpperCAmelCase					:		Dict=32   ,      _UpperCAmelCase					:		List[str]=512   ,      _UpperCAmelCase					:		Any=True   ,      **_UpperCAmelCase					:		Union[str, Any]   ,      )		->     Optional[Any]:




							"""simple docstring"""


							lowercase__      =	vocab_size
							lowercase__      =	max_position_embeddings
							lowercase__      =	d_model
							lowercase__      =	encoder_ffn_dim
							lowercase__      =	encoder_layers
							lowercase__      =	encoder_attention_heads
							lowercase__      =	decoder_ffn_dim
							lowercase__      =	decoder_layers
							lowercase__      =	decoder_attention_heads
							lowercase__      =	dropout
							lowercase__      =	attention_dropout
							lowercase__      =	activation_dropout
							lowercase__      =	activation_function
							lowercase__      =	init_std
							lowercase__      =	encoder_layerdrop
							lowercase__      =	decoder_layerdrop
							lowercase__      =	use_cache
							lowercase__      =	encoder_layers
							lowercase__      =	scale_embedding  # scale factor will be sqrt(d_model) if True

							lowercase__      =	num_global_tokens
							lowercase__      =	block_size
							lowercase__      =	stagger_local_blocks

							super().__init__(
							    pad_token_id=_UpperCAmelCase   ,      eos_token_id=_UpperCAmelCase   ,      is_encoder_decoder=_UpperCAmelCase   ,      decoder_start_token_id=_UpperCAmelCase   ,      forced_eos_token_id=_UpperCAmelCase   ,      **_UpperCAmelCase   ,      )

					@property
					def 						lowerCamelCase__  (self					:		Optional[Any]	)		->     int:




							"""simple docstring"""


							return self.encoder_attention_heads


					@property
					def 						lowerCamelCase__  (self					:		Tuple	)		->     int:




							"""simple docstring"""


							return self.d_model





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


A :	int												=     {
    'configuration_rwkv': ['RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RwkvConfig', 'RwkvOnnxConfig'],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A :	List[Any]												=     [
	    'RWKV_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'RwkvForCausalLM',
	    'RwkvModel',
	    'RwkvPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_rwkv import (
		    RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
		    RwkvForCausalLM,
		    RwkvModel,
		    RwkvPreTrainedModel,
		)
else:
	import sys

	A :	Optional[int]												=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

