
from ... import PretrainedConfig


lowercase    :   List[Any]		       =				{
    "sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json",
}

class __snake_case						( lowerCAmelCase	):
    _a						:		Dict=							NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP
    _a						:		Any=							"nezha"
    def __init__(    self						,snake_case=21128						,snake_case=768						,snake_case=12						,snake_case=12						,snake_case=3072						,snake_case="gelu"						,snake_case=0.1						,snake_case=0.1						,snake_case=512						,snake_case=64						,snake_case=2						,snake_case=0.02						,snake_case=1e-12						,snake_case=0.1						,snake_case=0						,snake_case=2						,snake_case=3						,snake_case=True						,**snake_case						,):



           '''simple docstring'''







           super().__init__(pad_token_id=a_						,bos_token_id=a_						,eos_token_id=a_						,**a_ )

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





from typing import Dict

from .base import GenericTensor, Pipeline


class 	__snake_case   ( SCREAMING_SNAKE_CASE ):
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_=None    ,a_=None    ,a_=None    ,**a_						):







						"""simple docstring"""
						if tokenize_kwargs is None:
										lowerCAmelCase__		  =  {}

						if truncation is not None:
										if "truncation" in tokenize_kwargs:
														raise ValueError(
														    'truncation parameter defined twice (given as keyword argument as well as in tokenize_kwargs)'						)
										lowerCAmelCase__		  =  truncation

						lowerCAmelCase__		  =  tokenize_kwargs

						lowerCAmelCase__		  =  {}
						if return_tensors is not None:
										lowerCAmelCase__		  =  return_tensors

						return preprocess_params, {}, postprocess_params
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,**a_						):







						"""simple docstring"""
						lowerCAmelCase__		  =  self.framework
						lowerCAmelCase__		  =  self.tokenizer(a_    ,return_tensors=a_    ,**a_						)
						return model_inputs
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_						):







						"""simple docstring"""
						lowerCAmelCase__		  =  self.model(**a_						)
						return model_outputs
		def 						SCREAMING_SNAKE_CASE_					(							self    ,a_    ,a_=False						):







						"""simple docstring"""
						# [0] is the first available tensor, logits or last_hidden_state.
						if return_tensors:
										return model_outputs[0]
						if self.framework == "pt":
										return model_outputs[0].tolist()
						elif self.framework == "tf":
										return model_outputs[0].numpy().tolist()



		def __call__(							self    ,*a_    ,**a_						):







						"""simple docstring"""
						return super().__call__(*a_    ,**a_						)
