



from typing import TYPE_CHECKING

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


__snake_case       :	str            ={
    'configuration_convbert': ['CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ConvBertConfig', 'ConvBertOnnxConfig'],
    'tokenization_convbert': ['ConvBertTokenizer'],
}

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__snake_case       :	Optional[int]            =['ConvBertTokenizerFast']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__snake_case       :	str            =[
							    'CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'ConvBertForMaskedLM',
							    'ConvBertForMultipleChoice',
							    'ConvBertForQuestionAnswering',
							    'ConvBertForSequenceClassification',
							    'ConvBertForTokenClassification',
							    'ConvBertLayer',
							    'ConvBertModel',
							    'ConvBertPreTrainedModel',
							    'load_tf_weights_in_convbert',
							]


try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__snake_case       :	Dict            =[
							    'TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'TFConvBertForMaskedLM',
							    'TFConvBertForMultipleChoice',
							    'TFConvBertForQuestionAnswering',
							    'TFConvBertForSequenceClassification',
							    'TFConvBertForTokenClassification',
							    'TFConvBertLayer',
							    'TFConvBertModel',
							    'TFConvBertPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig
							from .tokenization_convbert import ConvBertTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_convbert_fast import ConvBertTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_convbert import (
														    CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    ConvBertForMaskedLM,
														    ConvBertForMultipleChoice,
														    ConvBertForQuestionAnswering,
														    ConvBertForSequenceClassification,
														    ConvBertForTokenClassification,
														    ConvBertLayer,
														    ConvBertModel,
														    ConvBertPreTrainedModel,
														    load_tf_weights_in_convbert,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_convbert import (
														    TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFConvBertForMaskedLM,
														    TFConvBertForMultipleChoice,
														    TFConvBertForQuestionAnswering,
														    TFConvBertForSequenceClassification,
														    TFConvBertForTokenClassification,
														    TFConvBertLayer,
														    TFConvBertModel,
														    TFConvBertPreTrainedModel,
														)


else:
							import sys

							__snake_case       :	Any            =_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


__snake_case       :	List[Any]            =logging.get_logger(__name__)

__snake_case       :	str            ={
    'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json',
}



class  lowerCamelCase__    (							lowerCamelCase__):




		'''simple docstring'''



		snake_case_			="""mvp"""
		snake_case_			=["""past_key_values"""]
		snake_case_			={"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}



		def __init__(self	,__lowerCamelCase=5_02_67	,__lowerCamelCase=10_24	,__lowerCamelCase=12	,__lowerCamelCase=40_96	,__lowerCamelCase=16	,__lowerCamelCase=12	,__lowerCamelCase=40_96	,__lowerCamelCase=16	,__lowerCamelCase=0.0	,__lowerCamelCase=0.0	,__lowerCamelCase="gelu"	,__lowerCamelCase=10_24	,__lowerCamelCase=0.1	,__lowerCamelCase=0.0	,__lowerCamelCase=0.0	,__lowerCamelCase=0.02	,__lowerCamelCase=0.0	,__lowerCamelCase=False	,__lowerCamelCase=True	,__lowerCamelCase=1	,__lowerCamelCase=0	,__lowerCamelCase=2	,__lowerCamelCase=True	,__lowerCamelCase=2	,__lowerCamelCase=2	,__lowerCamelCase=False	,__lowerCamelCase=1_00	,__lowerCamelCase=8_00	,**__lowerCamelCase	,)  ->    Optional[Any]:

						"""simple docstring"""






						lowerCAmelCase__  :       Union[str, Any]				=  vocab_size
						lowerCAmelCase__  :       Dict				=  max_position_embeddings
						lowerCAmelCase__  :       Optional[int]				=  d_model
						lowerCAmelCase__  :       Any				=  encoder_ffn_dim
						lowerCAmelCase__  :       str				=  encoder_layers
						lowerCAmelCase__  :       Union[str, Any]				=  encoder_attention_heads
						lowerCAmelCase__  :       Dict				=  decoder_ffn_dim
						lowerCAmelCase__  :       Optional[int]				=  decoder_layers
						lowerCAmelCase__  :       int				=  decoder_attention_heads
						lowerCAmelCase__  :       str				=  dropout
						lowerCAmelCase__  :       int				=  attention_dropout
						lowerCAmelCase__  :       Optional[Any]				=  activation_dropout
						lowerCAmelCase__  :       Optional[int]				=  activation_function
						lowerCAmelCase__  :       int				=  init_std
						lowerCAmelCase__  :       List[Any]				=  encoder_layerdrop
						lowerCAmelCase__  :       Union[str, Any]				=  decoder_layerdrop
						lowerCAmelCase__  :       Tuple				=  classifier_dropout
						lowerCAmelCase__  :       Optional[int]				=  use_cache
						lowerCAmelCase__  :       List[Any]				=  encoder_layers
						lowerCAmelCase__  :       List[str]				=  scale_embedding  # scale factor will be sqrt(d_model) if True
						lowerCAmelCase__  :       Any				=  use_prompt
						lowerCAmelCase__  :       Optional[Any]				=  prompt_length
						lowerCAmelCase__  :       int				=  prompt_mid_dim

						super().__init__(
						    pad_token_id=__lowerCamelCase	,bos_token_id=__lowerCamelCase	,eos_token_id=__lowerCamelCase	,is_encoder_decoder=__lowerCamelCase	,decoder_start_token_id=__lowerCamelCase	,forced_eos_token_id=__lowerCamelCase	,**__lowerCamelCase	,)

						if self.forced_bos_token_id is None and kwargs.get('''force_bos_token_to_be_generated'''	,__lowerCamelCase				):
										lowerCAmelCase__  :       Union[str, Any]				=  self.bos_token_id
										warnings.warn(
										    f"""Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. """
										    '''The config can simply be saved and uploaded again to be fixed.'''				)

