




'''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,
)


a       :						Union[str, Any]								=		{'''configuration_xglm''': ['''XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XGLMConfig''']}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						a       :						str								=		['''XGLMTokenizer''']

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						a       :						List[str]								=		['''XGLMTokenizerFast''']

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


try:
						if not is_flax_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						a       :						Union[str, Any]								=		[
						    '''FlaxXGLMForCausalLM''',
						    '''FlaxXGLMModel''',
						    '''FlaxXGLMPreTrainedModel''',
						]


try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						a       :						Union[str, 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

						a       :						Optional[Any]								=		_LazyModule(__name__, globals()['''__file__'''], _import_structure)









'''simple docstring'''



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


A__						:   Tuple				=    logging.get_logger(__name__)

A__						:   Dict				=    {
    """RWKV/rwkv-4-169m-pile""": """https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-430m-pile""": """https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-1b5-pile""": """https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-3b-pile""": """https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-7b-pile""": """https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-14b-pile""": """https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json""",
    """RWKV/rwkv-raven-1b5""": """https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json""",
    """RWKV/rwkv-raven-3b""": """https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json""",
    """RWKV/rwkv-raven-7b""": """https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json""",
    """RWKV/rwkv-raven-14b""": """https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json""",
}





class   UpperCAmelCase_    (_UpperCAmelCase    ):





    """simple docstring"""






    lowerCamelCase    :   List[Any]					=     'rwkv'
    lowerCamelCase    :   Any					=     {'max_position_embeddings': 'context_length'}







    def __init__(				self     ,	SCREAMING_SNAKE_CASE_=5_02_77     ,	SCREAMING_SNAKE_CASE_=10_24     ,	SCREAMING_SNAKE_CASE_=40_96     ,	SCREAMING_SNAKE_CASE_=32     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_=1E-5     ,	SCREAMING_SNAKE_CASE_=0     ,	SCREAMING_SNAKE_CASE_=0     ,	SCREAMING_SNAKE_CASE_=6     ,	SCREAMING_SNAKE_CASE_=False     ,	SCREAMING_SNAKE_CASE_=True     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	Optional[Any]:
         __lowerCamelCase  :      Optional[int]														=						vocab_size
         __lowerCamelCase  :      Tuple														=						context_length
         __lowerCamelCase  :      str														=						hidden_size
         __lowerCamelCase  :      List[str]														=						num_hidden_layers
         __lowerCamelCase  :      Any														=						attention_hidden_size if attention_hidden_size is not None else hidden_size
         __lowerCamelCase  :      Optional[int]														=						intermediate_size if intermediate_size is not None else 4 * hidden_size
         __lowerCamelCase  :      Optional[Any]														=						layer_norm_epsilon
         __lowerCamelCase  :      int														=						rescale_every
         __lowerCamelCase  :      Tuple														=						use_cache

         __lowerCamelCase  :      int														=						bos_token_id
         __lowerCamelCase  :      Optional[Any]														=						eos_token_id

         super().__init__(
             tie_word_embeddings=SCREAMING_SNAKE_CASE_     ,	bos_token_id=SCREAMING_SNAKE_CASE_     ,	eos_token_id=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_      )






