


from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_UpperCAmelCase			:  Dict     =logging.get_logger(__name__)

_UpperCAmelCase			:  List[Any]     ={
    """google/bigbird-roberta-base""": """https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json""",
    """google/bigbird-roberta-large""": """https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json""",
    """google/bigbird-base-trivia-itc""": """https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json""",
    # See all BigBird models at https://huggingface.co/models?filter=big_bird
}







class 				snake_case__(							lowercase__							):







						'''simple docstring'''




						SCREAMING_SNAKE_CASE__      :  List[Any]					=							"""big_bird"""




						def __init__(				self   ,						__lowercase=5_0_3_5_8   ,						__lowercase=7_6_8   ,						__lowercase=1_2   ,						__lowercase=1_2   ,						__lowercase=3_0_7_2   ,						__lowercase="gelu_new"   ,						__lowercase=0.1   ,						__lowercase=0.1   ,						__lowercase=4_0_9_6   ,						__lowercase=2   ,						__lowercase=0.02   ,						__lowercase=1e-12   ,						__lowercase=True   ,						__lowercase=0   ,						__lowercase=1   ,						__lowercase=2   ,						__lowercase=6_6   ,						__lowercase="block_sparse"   ,						__lowercase=True   ,						__lowercase=False   ,						__lowercase=6_4   ,						__lowercase=3   ,						__lowercase=None   ,						**__lowercase   ,						)					->    List[str]:
										super().__init__(
										    pad_token_id=UpperCAmelCase__   ,						bos_token_id=UpperCAmelCase__   ,						eos_token_id=UpperCAmelCase__   ,						sep_token_id=UpperCAmelCase__   ,						**UpperCAmelCase__   ,						)

										lowerCAmelCase_ :      str    				=				vocab_size
										lowerCAmelCase_ :      Tuple    				=				max_position_embeddings
										lowerCAmelCase_ :      Dict    				=				hidden_size
										lowerCAmelCase_ :      Dict    				=				num_hidden_layers
										lowerCAmelCase_ :      List[Any]    				=				num_attention_heads
										lowerCAmelCase_ :      List[str]    				=				intermediate_size
										lowerCAmelCase_ :      Optional[int]    				=				hidden_act
										lowerCAmelCase_ :      Optional[int]    				=				hidden_dropout_prob
										lowerCAmelCase_ :      Tuple    				=				attention_probs_dropout_prob
										lowerCAmelCase_ :      List[str]    				=				initializer_range
										lowerCAmelCase_ :      Optional[int]    				=				type_vocab_size
										lowerCAmelCase_ :      int    				=				layer_norm_eps
										lowerCAmelCase_ :      Dict    				=				use_cache

										lowerCAmelCase_ :      Dict    				=				rescale_embeddings
										lowerCAmelCase_ :      List[Any]    				=				attention_type
										lowerCAmelCase_ :      Optional[int]    				=				use_bias
										lowerCAmelCase_ :      str    				=				block_size
										lowerCAmelCase_ :      Dict    				=				num_random_blocks
										lowerCAmelCase_ :      List[Any]    				=				classifier_dropout







class 				snake_case__(							lowercase__							):







						'''simple docstring'''




						@property
						def 						lowercase_ (				self							)					->    Optional[int]:
										if self.task == "multiple-choice":
														lowerCAmelCase_ :      str    				=				{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
										else:
														lowerCAmelCase_ :      List[Any]    				=				{0: '''batch''', 1: '''sequence'''}
										return OrderedDict(
										    [
										        ('''input_ids''', dynamic_axis),
										        ('''attention_mask''', dynamic_axis),
										    ]							)



from typing import TYPE_CHECKING

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


_UpperCAmelCase			:  Union[str, Any]     ={
    """configuration_llama""": ["""LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LlamaConfig"""],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Optional[Any]     =["""LlamaTokenizer"""]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Optional[int]     =["""LlamaTokenizerFast"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_UpperCAmelCase			:  Tuple     =[
						    """LlamaForCausalLM""",
						    """LlamaModel""",
						    """LlamaPreTrainedModel""",
						    """LlamaForSequenceClassification""",
						]


if TYPE_CHECKING:
						from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_llama import LlamaTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_llama_fast import LlamaTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_llama import LlamaForCausalLM, LlamaForSequenceClassification, LlamaModel, LlamaPreTrainedModel


else:
						import sys

						_UpperCAmelCase			:  List[Any]     =_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)