





from collections import OrderedDict
from typing import Mapping

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


_A				:							Tuple							= logging.get_logger(__name__)

_A				:							Union[str, 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  (     __SCREAMING_SNAKE_CASE						):


    '''simple docstring'''







    lowerCamelCase__						:		int							=  """ernie"""



    def __init__(					self      ,							A_=3_05_22      ,							A_=7_68      ,							A_=12      ,							A_=12      ,							A_=30_72      ,							A_="gelu"      ,							A_=0.1      ,							A_=0.1      ,							A_=5_12      ,							A_=2      ,							A_=3      ,							A_=False      ,							A_=0.02      ,							A_=1E-12      ,							A_=0      ,							A_="absolute"      ,							A_=True      ,							A_=None      ,							**A_      ,							):





        '''simple docstring'''

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

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





class 				__snake_case  (     __SCREAMING_SNAKE_CASE						):


    '''simple docstring'''







    @property
    def    lowercase_				(					self    ):





        '''simple docstring'''

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








import numpy as np

_A				:							List[Any]							= [
    ["""a""", """b""", """c""", """d""", """e"""],
    ["""f""", """g""", """h""", """i""", """k"""],
    ["""l""", """m""", """n""", """o""", """p"""],
    ["""q""", """r""", """s""", """t""", """u"""],
    ["""v""", """w""", """x""", """y""", """z"""],
]



class 				__snake_case  :


    '''simple docstring'''







    def __init__(					self    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= np.array(A_    )



    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__							,		SCREAMING_SNAKE_CASE__       							= np.where(letter == self.SQUARE    )
        SCREAMING_SNAKE_CASE__       							= np.concatenate([indexa + 1, indexa + 1]    )
        return indexes



    def    lowercase_				(					self      ,							A_      ,							A_    ):





        '''simple docstring'''

        return self.SQUARE[indexa - 1, indexa - 1]



    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= message.lower()
        SCREAMING_SNAKE_CASE__       							= message.replace('''j'''      ,							'''i'''    )

        SCREAMING_SNAKE_CASE__       							= ''''''
        for letter_index in range(len(A_    )    ):
            if message[letter_index] != " ":
                SCREAMING_SNAKE_CASE__       							= self.letter_to_numbers(message[letter_index]    )
                SCREAMING_SNAKE_CASE__       							= encoded_message + str(numbers[0]    ) + str(numbers[1]    )
            elif message[letter_index] == " ":
                SCREAMING_SNAKE_CASE__       							= encoded_message + ''' '''

        return encoded_message




    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= message.replace(''' '''      ,							'''  '''    )
        SCREAMING_SNAKE_CASE__       							= ''''''
        for numbers_index in range(int(len(A_    ) / 2    )    ):
            if message[numbers_index * 2] != " ":
                SCREAMING_SNAKE_CASE__       							= message[numbers_index * 2]
                SCREAMING_SNAKE_CASE__       							= message[numbers_index * 2 + 1]

                SCREAMING_SNAKE_CASE__       							= self.numbers_to_letter(int(A_    )      ,							int(A_    )    )
                SCREAMING_SNAKE_CASE__       							= decoded_message + letter
            elif message[numbers_index * 2] == " ":
                SCREAMING_SNAKE_CASE__       							= decoded_message + ''' '''

        return decoded_message
