






"""simple docstring"""

from typing import TYPE_CHECKING

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


_A						=			{
    'configuration_blip': [
        'BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BlipConfig',
        'BlipTextConfig',
        'BlipVisionConfig',
    ],
    'processing_blip': ['BlipProcessor'],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_A						=			['BlipImageProcessor']


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_A						=			[
					    'BLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'BlipModel',
					    'BlipPreTrainedModel',
					    'BlipForConditionalGeneration',
					    'BlipForQuestionAnswering',
					    'BlipVisionModel',
					    'BlipTextModel',
					    'BlipForImageTextRetrieval',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_A						=			[
					    'TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'TFBlipModel',
					    'TFBlipPreTrainedModel',
					    'TFBlipForConditionalGeneration',
					    'TFBlipForQuestionAnswering',
					    'TFBlipVisionModel',
					    'TFBlipTextModel',
					    'TFBlipForImageTextRetrieval',
					]

if TYPE_CHECKING:
					from .configuration_blip import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipTextConfig, BlipVisionConfig
					from .processing_blip import BlipProcessor

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .image_processing_blip import BlipImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_blip import (
										    BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
										    BlipForConditionalGeneration,
										    BlipForImageTextRetrieval,
										    BlipForQuestionAnswering,
										    BlipModel,
										    BlipPreTrainedModel,
										    BlipTextModel,
										    BlipVisionModel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_blip import (
										    TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFBlipForConditionalGeneration,
										    TFBlipForImageTextRetrieval,
										    TFBlipForQuestionAnswering,
										    TFBlipModel,
										    TFBlipPreTrainedModel,
										    TFBlipTextModel,
										    TFBlipVisionModel,
										)

else:
					import sys

					_A						=			_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


_A						=			logging.get_logger(__name__)

_A						=			{
    'google/bigbird-roberta-base': 'https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json',
    'google/bigbird-roberta-large': 'https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json',
    'google/bigbird-base-trivia-itc': 'https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json',
    # See all BigBird models at https://huggingface.co/models?filter=big_bird
}






class 	_lowercase       (    __UpperCAmelCase		):
	lowercase_				=     'big_bird'




	def __init__(			self		,			UpperCAmelCase_=50358		,			UpperCAmelCase_=768		,			UpperCAmelCase_=12		,			UpperCAmelCase_=12		,			UpperCAmelCase_=3072		,			UpperCAmelCase_="gelu_new"		,			UpperCAmelCase_=0.1		,			UpperCAmelCase_=0.1		,			UpperCAmelCase_=4096		,			UpperCAmelCase_=2		,			UpperCAmelCase_=0.02		,			UpperCAmelCase_=1E-1_2		,			UpperCAmelCase_=True		,			UpperCAmelCase_=0		,			UpperCAmelCase_=1		,			UpperCAmelCase_=2		,			UpperCAmelCase_=66		,			UpperCAmelCase_="block_sparse"		,			UpperCAmelCase_=True		,			UpperCAmelCase_=False		,			UpperCAmelCase_=64		,			UpperCAmelCase_=3		,			UpperCAmelCase_=None		,			**UpperCAmelCase_		,			)		->							Union[str, Any]:
			super().__init__(
			    pad_token_id=UpperCAmelCase_		,			bos_token_id=UpperCAmelCase_		,			eos_token_id=UpperCAmelCase_		,			sep_token_id=UpperCAmelCase_		,			**UpperCAmelCase_		,			)

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

			lowerCamelCase					:      Tuple          =   rescale_embeddings
			lowerCamelCase					:      Dict          =   attention_type
			lowerCamelCase					:      Optional[int]          =   use_bias
			lowerCamelCase					:      Optional[int]          =   block_size
			lowerCamelCase					:      Tuple          =   num_random_blocks
			lowerCamelCase					:      List[Any]          =   classifier_dropout






class 	_lowercase       (    __UpperCAmelCase		):




	@property
	def       _UpperCamelCase   (			self )		->							Mapping[str, Mapping[int, str]]:
			if self.task == "multiple-choice":
					lowerCamelCase					:      Tuple          =   {0: 'batch', 1: 'choice', 2: 'sequence'}
			else:
					lowerCamelCase					:      int          =   {0: 'batch', 1: 'sequence'}
			return OrderedDict(
			    [
			        ('input_ids', dynamic_axis),
			        ('attention_mask', dynamic_axis),
			    ] )






