

from collections import OrderedDict
from typing import Mapping

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


A_						:     Optional[int]			  =				logging.get_logger(__name__)

A_						:     int			  =				{
    '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    A_				( _a  ):


    '''simple docstring'''






    a__       							=    "ernie"


    def __init__(self       , lowercase__=30_522       , lowercase__=768       , lowercase__=12       , lowercase__=12       , lowercase__=3_072       , lowercase__="gelu"       , lowercase__=0.1       , lowercase__=0.1       , lowercase__=512       , lowercase__=2       , lowercase__=3       , lowercase__=False       , lowercase__=0.02       , lowercase__=1E-12       , lowercase__=0       , lowercase__="absolute"       , lowercase__=True       , lowercase__=None       , **lowercase__       , )       -> int:
        super().__init__(pad_token_id=lowercase__       , **lowercase__					)

        __UpperCAmelCase			   =     vocab_size
        __UpperCAmelCase			   =     hidden_size
        __UpperCAmelCase			   =     num_hidden_layers
        __UpperCAmelCase			   =     num_attention_heads
        __UpperCAmelCase			   =     hidden_act
        __UpperCAmelCase			   =     intermediate_size
        __UpperCAmelCase			   =     hidden_dropout_prob
        __UpperCAmelCase			   =     attention_probs_dropout_prob
        __UpperCAmelCase			   =     max_position_embeddings
        __UpperCAmelCase			   =     type_vocab_size
        __UpperCAmelCase			   =     task_type_vocab_size
        __UpperCAmelCase			   =     use_task_id
        __UpperCAmelCase			   =     initializer_range
        __UpperCAmelCase			   =     layer_norm_eps
        __UpperCAmelCase			   =     position_embedding_type
        __UpperCAmelCase			   =     use_cache
        __UpperCAmelCase			   =     classifier_dropout






class    A_				( _a  ):


    '''simple docstring'''






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






def  __a    (				SCREAMING_SNAKE_CASE ) ->       float:






    '''simple docstring'''
    return -num if num < 0 else num


def  __a    (				SCREAMING_SNAKE_CASE ) ->       int:






    '''simple docstring'''
    if len(SCREAMING_SNAKE_CASE ) == 0:
        raise ValueError('''abs_min() arg is an empty sequence''' )
    __UpperCAmelCase			   =     x[0]
    for i in x:
        if abs_val(SCREAMING_SNAKE_CASE ) < abs_val(SCREAMING_SNAKE_CASE ):
            __UpperCAmelCase			   =     i
    return j


def  __a    (				SCREAMING_SNAKE_CASE ) ->       int:






    '''simple docstring'''
    if len(SCREAMING_SNAKE_CASE ) == 0:
        raise ValueError('''abs_max() arg is an empty sequence''' )
    __UpperCAmelCase			   =     x[0]
    for i in x:
        if abs(SCREAMING_SNAKE_CASE ) > abs(SCREAMING_SNAKE_CASE ):
            __UpperCAmelCase			   =     i
    return j


def  __a    (				SCREAMING_SNAKE_CASE ) ->       int:






    '''simple docstring'''
    if len(SCREAMING_SNAKE_CASE ) == 0:
        raise ValueError('''abs_max_sort() arg is an empty sequence''' )
    return sorted(SCREAMING_SNAKE_CASE    ,				key=SCREAMING_SNAKE_CASE )[-1]


def  __a    (				) ->       Union[str, Any]:






    '''simple docstring'''
    assert abs_val(0 ) == 0
    assert abs_val(3_4 ) == 3_4
    assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0 ) == 1_0_0_0_0_0_0_0_0_0_0_0

    __UpperCAmelCase			   =     [-3, -1, 2, -1_1]
    assert abs_max(SCREAMING_SNAKE_CASE ) == -1_1
    assert abs_max_sort(SCREAMING_SNAKE_CASE ) == -1_1
    assert abs_min(SCREAMING_SNAKE_CASE ) == -1


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       test_abs_val()
       print(abs_val(-34))  # --> 34




