



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


__SCREAMING_SNAKE_CASE           =  logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE           =  {
    """funnel-transformer/small""": """https://huggingface.co/funnel-transformer/small/resolve/main/config.json""",
    """funnel-transformer/small-base""": """https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json""",
    """funnel-transformer/medium""": """https://huggingface.co/funnel-transformer/medium/resolve/main/config.json""",
    """funnel-transformer/medium-base""": """https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json""",
    """funnel-transformer/intermediate""": (
        """https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json"""
    ),
    """funnel-transformer/intermediate-base""": (
        """https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json"""
    ),
    """funnel-transformer/large""": """https://huggingface.co/funnel-transformer/large/resolve/main/config.json""",
    """funnel-transformer/large-base""": """https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json""",
    """funnel-transformer/xlarge""": """https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json""",
    """funnel-transformer/xlarge-base""": """https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json""",
}

class 	lowerCamelCase_    ( _A						):






						'''simple docstring'''
						a__   =  "funnel"
						a__   =  {
						    "hidden_size": "d_model",
						    "num_attention_heads": "n_head",
						}







						def __init__(	self      :			int	,	__lowerCamelCase      :			Any=3_05_22	,	__lowerCamelCase      :			int=[4, 4, 4]	,	__lowerCamelCase      :			Union[str, Any]=None	,	__lowerCamelCase      :			Any=2	,	__lowerCamelCase      :			int=7_68	,	__lowerCamelCase      :			Optional[Any]=12	,	__lowerCamelCase      :			Optional[int]=64	,	__lowerCamelCase      :			Any=30_72	,	__lowerCamelCase      :			Tuple="gelu_new"	,	__lowerCamelCase      :			Any=0.1	,	__lowerCamelCase      :			Optional[Any]=0.1	,	__lowerCamelCase      :			str=0.0	,	__lowerCamelCase      :			Tuple=0.1	,	__lowerCamelCase      :			Tuple=None	,	__lowerCamelCase      :			Optional[Any]=1e-9	,	__lowerCamelCase      :			Any="mean"	,	__lowerCamelCase      :			Optional[Any]="relative_shift"	,	__lowerCamelCase      :			Any=True	,	__lowerCamelCase      :			Dict=True	,	__lowerCamelCase      :			Optional[int]=True	,	**__lowerCamelCase      :			Optional[int]	,	)      ->				Any:
									A							:					Dict              =						vocab_size
									A							:					Tuple              =						block_sizes
									A							:					Union[str, Any]              =						[1] * len(__lowerCamelCase ) if block_repeats is None else block_repeats
									assert len(__lowerCamelCase ) == len(
									    self.block_repeats ), "`block_sizes` and `block_repeats` should have the same length."
									A							:					int              =						num_decoder_layers
									A							:					Tuple              =						d_model
									A							:					int              =						n_head
									A							:					Any              =						d_head
									A							:					List[Any]              =						d_inner
									A							:					str              =						hidden_act
									A							:					Union[str, Any]              =						hidden_dropout
									A							:					int              =						attention_dropout
									A							:					Optional[int]              =						activation_dropout
									A							:					Tuple              =						initializer_range
									A							:					Optional[Any]              =						initializer_std
									A							:					Union[str, Any]              =						layer_norm_eps
									assert pooling_type in [
									    "mean",
									    "max",
									], F"""Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."""
									A							:					Tuple              =						pooling_type
									assert attention_type in [
									    "relative_shift",
									    "factorized",
									], F"""Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."""
									A							:					Union[str, Any]              =						attention_type
									A							:					Tuple              =						separate_cls
									A							:					List[str]              =						truncate_seq
									A							:					Dict              =						pool_q_only

									super().__init__(**__lowerCamelCase )







						@property
						def 			SCREAMING_SNAKE_CASE__		(	self      :			Union[str, Any] )      ->				str:
									return sum(self.block_sizes )







						@num_hidden_layers.setter
						def 			SCREAMING_SNAKE_CASE__		(	self      :			int	,	__lowerCamelCase      :			int )      ->				Dict:
									raise NotImplementedError(
									    "This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`." )







						@property
						def 			SCREAMING_SNAKE_CASE__		(	self      :			Union[str, Any] )      ->				int:
									return len(self.block_sizes )







						@num_blocks.setter
						def 			SCREAMING_SNAKE_CASE__		(	self      :			List[Any]	,	__lowerCamelCase      :			Tuple )      ->				str:
									raise NotImplementedError("This model does not support the setting of `num_blocks`. Please set `block_sizes`." )




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__SCREAMING_SNAKE_CASE           =  {
    """configuration_instructblip""": [
        """INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """InstructBlipConfig""",
        """InstructBlipQFormerConfig""",
        """InstructBlipVisionConfig""",
    ],
    """processing_instructblip""": ["""InstructBlipProcessor"""],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__SCREAMING_SNAKE_CASE           =  [
							    """INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """InstructBlipQFormerModel""",
							    """InstructBlipPreTrainedModel""",
							    """InstructBlipForConditionalGeneration""",
							    """InstructBlipVisionModel""",
							]

if TYPE_CHECKING:
							from .configuration_instructblip import (
							    INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    InstructBlipConfig,
							    InstructBlipQFormerConfig,
							    InstructBlipVisionConfig,
							)
							from .processing_instructblip import InstructBlipProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_instructblip import (
														    INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
														    InstructBlipForConditionalGeneration,
														    InstructBlipPreTrainedModel,
														    InstructBlipQFormerModel,
														    InstructBlipVisionModel,
														)

else:
							import sys

							__SCREAMING_SNAKE_CASE           =  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)