
"""simple docstring"""
from collections import OrderedDict
from typing import Mapping

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


lowercase		:						List[str] =					logging.get_logger(__name__)

lowercase		:						Any =					{
    'nghuyong/ernie-1.0-base-zh': 'https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-2.0-base-en': 'https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json',
    'nghuyong/ernie-2.0-large-en': 'https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json',
    'nghuyong/ernie-3.0-base-zh': 'https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-medium-zh': 'https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-mini-zh': 'https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-micro-zh': 'https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-nano-zh': 'https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json',
    'nghuyong/ernie-gram-zh': 'https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json',
    'nghuyong/ernie-health-zh': 'https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json',
}




class    _snake_case  (						_lowercase       ):
							SCREAMING_SNAKE_CASE		     =						'''ernie'''






							def __init__(					self						:			Optional[int]						, snake_case__						:			Union[str, Any]=3_0_5_2_2						, snake_case__						:			str=7_6_8						, snake_case__						:			Optional[int]=1_2						, snake_case__						:			Optional[Any]=1_2						, snake_case__						:			str=3_0_7_2						, snake_case__						:			Union[str, Any]="gelu"						, snake_case__						:			Tuple=0.1						, snake_case__						:			Optional[int]=0.1						, snake_case__						:			Optional[int]=5_1_2						, snake_case__						:			Union[str, Any]=2						, snake_case__						:			int=3						, snake_case__						:			Tuple=False						, snake_case__						:			List[str]=0.02						, snake_case__						:			str=1e-12						, snake_case__						:			Union[str, Any]=0						, snake_case__						:			Tuple="absolute"						, snake_case__						:			Optional[int]=True						, snake_case__						:			Tuple=None						, **snake_case__						:			Union[str, Any]						, ):






												"""simple docstring"""



												super().__init__(pad_token_id=snake_case__						, **snake_case__    )

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






class    _snake_case  (						_lowercase       ):






							@property
							def 							__lowercase  (					self						:			List[str]    ):






												"""simple docstring"""



												if self.task == "multiple-choice":
																	__a:						Dict		    =					{0: """batch""", 1: """choice""", 2: """sequence"""}
												else:
																	__a:						Union[str, Any]		    =					{0: """batch""", 1: """sequence"""}
												return OrderedDict(
												    [
												        ("""input_ids""", dynamic_axis),
												        ("""attention_mask""", dynamic_axis),
												        ("""token_type_ids""", dynamic_axis),
												        ("""task_type_ids""", dynamic_axis),
												    ]    )


"""simple docstring"""
from typing import TYPE_CHECKING

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


lowercase		:						List[str] =					{
    'configuration_open_llama': ['OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'OpenLlamaConfig'],
}

try:
			if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:						Tuple =					['LlamaTokenizer']

try:
			if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:						Dict =					['LlamaTokenizerFast']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:						List[Any] =					[
			    'OpenLlamaForCausalLM',
			    'OpenLlamaModel',
			    'OpenLlamaPreTrainedModel',
			    'OpenLlamaForSequenceClassification',
			]


if TYPE_CHECKING:
			from .configuration_open_llama import OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig

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

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

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_open_llama import (
						    OpenLlamaForCausalLM,
						    OpenLlamaForSequenceClassification,
						    OpenLlamaModel,
						    OpenLlamaPreTrainedModel,
						)


else:
			import sys

			lowercase		:						Dict =					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
