



'''simple docstring'''


from torch import nn







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Union[str, Any]						):
						if act_fn in ["swish", "silu"]:
												return nn.SiLU()
						elif act_fn == "mish":
												return nn.Mish()
						elif act_fn == "gelu":
												return nn.GELU()
						else:
												raise ValueError(F"""Unsupported activation function: {act_fn}"""						)







'''simple docstring'''


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


lowercase_      :				Optional[Any]   					=    logging.get_logger(__name__)

lowercase_      :				int   					=    {
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}




class      __UpperCamelCase       (_UpperCAmelCase			):
	__A			  =					'''gpt_bigcode'''
	__A			  =					['''past_key_values''']
	__A			  =					{
	    '''hidden_size''': '''n_embd''',
	    '''max_position_embeddings''': '''n_positions''',
	    '''num_attention_heads''': '''n_head''',
	    '''num_hidden_layers''': '''n_layer''',
	}







	def __init__(    self ,				_lowerCAmelCase=5_0257 ,				_lowerCAmelCase=1024 ,				_lowerCAmelCase=768 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=None ,				_lowerCAmelCase="gelu_pytorch_tanh" ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=1E-5 ,				_lowerCAmelCase=0.02 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				**_lowerCAmelCase ,				)    ->    Optional[int]:
							'''simple docstring'''






							lowercase        =							vocab_size
							lowercase        =							n_positions
							lowercase        =							n_embd
							lowercase        =							n_layer
							lowercase        =							n_head
							lowercase        =							n_inner
							lowercase        =							activation_function
							lowercase        =							resid_pdrop
							lowercase        =							embd_pdrop
							lowercase        =							attn_pdrop
							lowercase        =							layer_norm_epsilon
							lowercase        =							initializer_range
							lowercase        =							scale_attn_weights
							lowercase        =							use_cache
							lowercase        =							attention_softmax_in_fpaa
							lowercase        =							scale_attention_softmax_in_fpaa
							lowercase        =							multi_query

							lowercase        =							bos_token_id
							lowercase        =							eos_token_id

							super().__init__(bos_token_id=_lowerCAmelCase ,				eos_token_id=_lowerCAmelCase ,				**_lowerCAmelCase						)


