


import warnings

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


_snake_case	:						Tuple         =							logging.get_logger(__name__)

_snake_case	:						Optional[int]         =							{
    "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json",
}

class 							a						(_lowerCAmelCase ):




							"""simple docstring"""


							__UpperCAmelCase       :				Optional[int]	    =    "mvp"
							__UpperCAmelCase       :				Optional[int]	    =    ["past_key_values"]
							__UpperCAmelCase       :				Optional[Any]	    =    {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}

							def __init__(				self			:    Union[str, Any]       ,      lowerCamelCase			:    str=50267       ,      lowerCamelCase			:    str=1024       ,      lowerCamelCase			:    Any=12       ,      lowerCamelCase			:    List[str]=4096       ,      lowerCamelCase			:    Dict=16       ,      lowerCamelCase			:    Optional[Any]=12       ,      lowerCamelCase			:    List[Any]=4096       ,      lowerCamelCase			:    Dict=16       ,      lowerCamelCase			:    Any=0.0       ,      lowerCamelCase			:    List[str]=0.0       ,      lowerCamelCase			:    Dict="gelu"       ,      lowerCamelCase			:    Optional[Any]=1024       ,      lowerCamelCase			:    Optional[int]=0.1       ,      lowerCamelCase			:    List[Any]=0.0       ,      lowerCamelCase			:    str=0.0       ,      lowerCamelCase			:    Any=0.02       ,      lowerCamelCase			:    Any=0.0       ,      lowerCamelCase			:    Dict=False       ,      lowerCamelCase			:    Optional[Any]=True       ,      lowerCamelCase			:    List[Any]=1       ,      lowerCamelCase			:    Tuple=0       ,      lowerCamelCase			:    Optional[int]=2       ,      lowerCamelCase			:    Union[str, Any]=True       ,      lowerCamelCase			:    Any=2       ,      lowerCamelCase			:    Union[str, Any]=2       ,      lowerCamelCase			:    Tuple=False       ,      lowerCamelCase			:    str=100       ,      lowerCamelCase			:    int=800       ,      **lowerCamelCase			:    Optional[int]       ,      )      ->       Any:
														__snake_case						:     Tuple									=  vocab_size
														__snake_case						:     Union[str, Any]									=  max_position_embeddings
														__snake_case						:     Union[str, Any]									=  d_model
														__snake_case						:     List[str]									=  encoder_ffn_dim
														__snake_case						:     Tuple									=  encoder_layers
														__snake_case						:     Dict									=  encoder_attention_heads
														__snake_case						:     str									=  decoder_ffn_dim
														__snake_case						:     Optional[int]									=  decoder_layers
														__snake_case						:     Optional[int]									=  decoder_attention_heads
														__snake_case						:     List[str]									=  dropout
														__snake_case						:     Dict									=  attention_dropout
														__snake_case						:     int									=  activation_dropout
														__snake_case						:     Optional[int]									=  activation_function
														__snake_case						:     Any									=  init_std
														__snake_case						:     Any									=  encoder_layerdrop
														__snake_case						:     Optional[int]									=  decoder_layerdrop
														__snake_case						:     Dict									=  classifier_dropout
														__snake_case						:     Union[str, Any]									=  use_cache
														__snake_case						:     List[Any]									=  encoder_layers
														__snake_case						:     List[Any]									=  scale_embedding  # scale factor will be sqrt(d_model) if True
														__snake_case						:     List[str]									=  use_prompt
														__snake_case						:     Union[str, Any]									=  prompt_length
														__snake_case						:     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							):
																					__snake_case						:     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."							)








"""simple docstring"""


from typing import TYPE_CHECKING

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


__magic_name__       :					Dict						=			{
    """configuration_layoutlmv3""": [
        """LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """LayoutLMv3Config""",
        """LayoutLMv3OnnxConfig""",
    ],
    """processing_layoutlmv3""": ["""LayoutLMv3Processor"""],
    """tokenization_layoutlmv3""": ["""LayoutLMv3Tokenizer"""],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__       :					Optional[Any]						=			["""LayoutLMv3TokenizerFast"""]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__       :					int						=			[
		    """LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """LayoutLMv3ForQuestionAnswering""",
		    """LayoutLMv3ForSequenceClassification""",
		    """LayoutLMv3ForTokenClassification""",
		    """LayoutLMv3Model""",
		    """LayoutLMv3PreTrainedModel""",
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__       :					Tuple						=			[
		    """TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TFLayoutLMv3ForQuestionAnswering""",
		    """TFLayoutLMv3ForSequenceClassification""",
		    """TFLayoutLMv3ForTokenClassification""",
		    """TFLayoutLMv3Model""",
		    """TFLayoutLMv3PreTrainedModel""",
		]

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__       :					Union[str, Any]						=			["""LayoutLMv3FeatureExtractor"""]
		__magic_name__       :					Any						=			["""LayoutLMv3ImageProcessor"""]


if TYPE_CHECKING:
		from .configuration_layoutlmva import (
		    LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    LayoutLMvaConfig,
		    LayoutLMvaOnnxConfig,
		)
		from .processing_layoutlmva import LayoutLMvaProcessor
		from .tokenization_layoutlmva import LayoutLMvaTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_layoutlmva_fast import LayoutLMvaTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_layoutlmva import (
				    LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LayoutLMvaForQuestionAnswering,
				    LayoutLMvaForSequenceClassification,
				    LayoutLMvaForTokenClassification,
				    LayoutLMvaModel,
				    LayoutLMvaPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_layoutlmva import (
				    TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFLayoutLMvaForQuestionAnswering,
				    TFLayoutLMvaForSequenceClassification,
				    TFLayoutLMvaForTokenClassification,
				    TFLayoutLMvaModel,
				    TFLayoutLMvaPreTrainedModel,
				)

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_layoutlmva import LayoutLMvaFeatureExtractor
				from .image_processing_layoutlmva import LayoutLMvaImageProcessor

else:
		import sys

		__magic_name__       :					Union[str, Any]						=			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



