


'''simple docstring'''




# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowerCAmelCase  :		List[Any]		     =	{
    'configuration_vivit': ['VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VivitConfig'],
}
try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCAmelCase  :		Dict		     =	['VivitImageProcessor']


try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCAmelCase  :		Any		     =	[
				    'VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'VivitModel',
				    'VivitPreTrainedModel',
				    'VivitForVideoClassification',
				]


if TYPE_CHECKING:
				from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .image_processing_vivit import VivitImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_vivit import (
								    VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    VivitForVideoClassification,
								    VivitModel,
								    VivitPreTrainedModel,
								)


else:
				import sys

				_lowerCAmelCase  :		Tuple		     =	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)









'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

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


_lowerCAmelCase  :		Tuple		     =	logging.get_logger(__name__)

_lowerCAmelCase  :		List[str]		     =	{
    'facebook/xmod-base': 'https://huggingface.co/facebook/xmod-base/resolve/main/config.json',
    'facebook/xmod-large-prenorm': 'https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json',
    'facebook/xmod-base-13-125k': 'https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json',
    'facebook/xmod-base-30-125k': 'https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json',
    'facebook/xmod-base-30-195k': 'https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json',
    'facebook/xmod-base-60-125k': 'https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json',
    'facebook/xmod-base-60-265k': 'https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json',
    'facebook/xmod-base-75-125k': 'https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json',
    'facebook/xmod-base-75-269k': 'https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json',
}



class  lowerCAmelCase				(				a							):
	_lowerCamelCase   :					int			      = """xmod"""



	def __init__(					self ,					snake_case__=3_0522 ,					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__=2 ,					snake_case__=0.0_2 ,					snake_case__=1e-1_2 ,					snake_case__=1 ,					snake_case__=0 ,					snake_case__=2 ,					snake_case__="absolute" ,					snake_case__=True ,					snake_case__=None ,					snake_case__=False ,					snake_case__=2 ,					snake_case__=False ,					snake_case__=True ,					snake_case__=True ,					snake_case__=("en_XX",) ,					snake_case__=None ,					**snake_case__ ,					):
		super().__init__(pad_token_id=snake_case__ ,					bos_token_id=snake_case__ ,					eos_token_id=snake_case__ ,					**snake_case__    )

		lowerCAmelCase					:    Dict      							= vocab_size
		lowerCAmelCase					:    Optional[Any]      							= hidden_size
		lowerCAmelCase					:    int      							= num_hidden_layers
		lowerCAmelCase					:    List[Any]      							= num_attention_heads
		lowerCAmelCase					:    List[Any]      							= hidden_act
		lowerCAmelCase					:    Optional[int]      							= intermediate_size
		lowerCAmelCase					:    Optional[int]      							= hidden_dropout_prob
		lowerCAmelCase					:    Optional[Any]      							= attention_probs_dropout_prob
		lowerCAmelCase					:    str      							= max_position_embeddings
		lowerCAmelCase					:    int      							= type_vocab_size
		lowerCAmelCase					:    List[Any]      							= initializer_range
		lowerCAmelCase					:    Any      							= layer_norm_eps
		lowerCAmelCase					:    Dict      							= position_embedding_type
		lowerCAmelCase					:    Optional[Any]      							= use_cache
		lowerCAmelCase					:    Union[str, Any]      							= classifier_dropout
		lowerCAmelCase					:    int      							= pre_norm
		lowerCAmelCase					:    Optional[Any]      							= adapter_reduction_factor
		lowerCAmelCase					:    Any      							= adapter_layer_norm
		lowerCAmelCase					:    Dict      							= adapter_reuse_layer_norm
		lowerCAmelCase					:    Any      							= ln_before_adapter
		lowerCAmelCase					:    Optional[Any]      							= list(snake_case__    )
		lowerCAmelCase					:    List[Any]      							= default_language



class  lowerCAmelCase				(				a							):



	@property
	def 				lowercase     (					self    ):
		if self.task == "multiple-choice":
			lowerCAmelCase					:    List[Any]      							= {0: 'batch', 1: 'choice', 2: 'sequence'}
		else:
			lowerCAmelCase					:    Optional[int]      							= {0: 'batch', 1: 'sequence'}
		return OrderedDict(
		    [
		        ('input_ids', dynamic_axis),
		        ('attention_mask', dynamic_axis),
		    ]    )
