


'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase_						:  Dict				  =						{'configuration_xglm': ['XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XGLMConfig']}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Optional[int]				  =						['XGLMTokenizer']

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Tuple				  =						['XGLMTokenizerFast']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  List[Any]				  =						[
				    'XGLM_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'XGLMForCausalLM',
				    'XGLMModel',
				    'XGLMPreTrainedModel',
				]


try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  Tuple				  =						[
				    'FlaxXGLMForCausalLM',
				    'FlaxXGLMModel',
				    'FlaxXGLMPreTrainedModel',
				]


try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_						:  List[Any]				  =						[
				    'TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'TFXGLMForCausalLM',
				    'TFXGLMModel',
				    'TFXGLMPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig

				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_xglm import XGLMTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_xglm_fast import XGLMTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_xglm import FlaxXGLMForCausalLM, FlaxXGLMModel, FlaxXGLMPreTrainedModel

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_xglm import (
								    TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFXGLMForCausalLM,
								    TFXGLMModel,
								    TFXGLMPreTrainedModel,
								)


else:
				import sys

				UpperCAmelCase_						:  str				  =						_LazyModule(__name__, globals()['__file__'], _import_structure)








'''simple docstring'''


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


UpperCAmelCase_						:  List[Any]				  =						logging.get_logger(__name__)

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





class        lowercase__    (		_snake_case   ):





							'''simple docstring'''


							A_				: Dict       =    """gpt_bigcode"""
							A_				: str       =    ["""past_key_values"""]
							A_				: Tuple       =    {
							    """hidden_size""": """n_embd""",
							    """max_position_embeddings""": """n_positions""",
							    """num_attention_heads""": """n_head""",
							    """num_hidden_layers""": """n_layer""",
							}






							def __init__(       self       ,   __snake_case=5_0257       ,   __snake_case=1024       ,   __snake_case=768       ,   __snake_case=12       ,   __snake_case=12       ,   __snake_case=None       ,   __snake_case="gelu_pytorch_tanh"       ,   __snake_case=0.1       ,   __snake_case=0.1       ,   __snake_case=0.1       ,   __snake_case=1e-5       ,   __snake_case=0.02       ,   __snake_case=True       ,   __snake_case=True       ,   __snake_case=5_0256       ,   __snake_case=5_0256       ,   __snake_case=True       ,   __snake_case=True       ,   __snake_case=True       ,   **__snake_case       ,   ):
											_SCREAMING_SNAKE_CASE					:			Optional[Any]							= vocab_size
											_SCREAMING_SNAKE_CASE					:			Optional[Any]							= n_positions
											_SCREAMING_SNAKE_CASE					:			List[Any]							= n_embd
											_SCREAMING_SNAKE_CASE					:			Union[str, Any]							= n_layer
											_SCREAMING_SNAKE_CASE					:			Union[str, Any]							= n_head
											_SCREAMING_SNAKE_CASE					:			Optional[int]							= n_inner
											_SCREAMING_SNAKE_CASE					:			Optional[Any]							= activation_function
											_SCREAMING_SNAKE_CASE					:			Union[str, Any]							= resid_pdrop
											_SCREAMING_SNAKE_CASE					:			Union[str, Any]							= embd_pdrop
											_SCREAMING_SNAKE_CASE					:			List[Any]							= attn_pdrop
											_SCREAMING_SNAKE_CASE					:			Optional[int]							= layer_norm_epsilon
											_SCREAMING_SNAKE_CASE					:			Any							= initializer_range
											_SCREAMING_SNAKE_CASE					:			str							= scale_attn_weights
											_SCREAMING_SNAKE_CASE					:			Tuple							= use_cache
											_SCREAMING_SNAKE_CASE					:			Optional[int]							= attention_softmax_in_fpaa
											_SCREAMING_SNAKE_CASE					:			List[Any]							= scale_attention_softmax_in_fpaa
											_SCREAMING_SNAKE_CASE					:			Any							= multi_query

											_SCREAMING_SNAKE_CASE					:			Optional[int]							= bos_token_id
											_SCREAMING_SNAKE_CASE					:			Optional[int]							= eos_token_id

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




