'''simple docstring'''




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


__SCREAMING_SNAKE_CASE :  str  =						logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE :  Any  =						{
    """ZinengTang/tvlt-base""": """https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json""",
}

class 			lowerCamelCase_			(snake_case__					):
      '''simple docstring'''

      __UpperCamelCase:						List[Any]      			=		"tvlt"




      def __init__( self		:       Any		,      A		:       Union[str, Any]=224		,      A		:       Dict=2048		,      A		:       List[str]=128		,      A		:       Any=[16, 16]		,      A		:       Tuple=[16, 16]		,      A		:       Optional[Any]=3		,      A		:       str=1		,      A		:       str=8		,      A		:       Union[str, Any]=768		,      A		:       Dict=12		,      A		:       Tuple=12		,      A		:       Union[str, Any]=3072		,      A		:       List[str]="gelu"		,      A		:       List[Any]=0.0		,      A		:       str=0.0		,      A		:       Union[str, Any]=0.02		,      A		:       Any=1E-6		,      A		:       List[str]=True		,      A		:       Optional[int]=False		,      A		:       Any=16		,      A		:       int=512		,      A		:       Tuple=8		,      A		:       Dict=2048		,      A		:       Tuple=0.75		,      A		:       Dict=0.15		,      A		:       List[str]="frame-level"		,      A		:       int=True		,      A		:       Dict=True		,      A		:       Tuple="classification"		,      **A		:       Any		,      ):
             super().__init__(**A )

             if audio_mask_type not in ("frame-level", "patch_level"):
                    raise ValueError(
                        "audio_mask_type must be one of two acceptable strategies - {'frame_level', 'patch-level') "
                        F"""got {audio_mask_type}""" )

             _UpperCAmelCase  :						List[str]							   =					image_size
             _UpperCAmelCase  :						Tuple							   =					spectrogram_length
             _UpperCAmelCase  :						Any							   =					frequency_length
             _UpperCAmelCase  :						Tuple							   =					image_patch_size
             _UpperCAmelCase  :						List[str]							   =					audio_patch_size
             _UpperCAmelCase  :						Tuple							   =					num_image_channels
             _UpperCAmelCase  :						Dict							   =					num_audio_channels
             _UpperCAmelCase  :						Dict							   =					num_frames

             _UpperCAmelCase  :						Union[str, Any]							   =					hidden_size
             _UpperCAmelCase  :						str							   =					num_hidden_layers
             _UpperCAmelCase  :						Any							   =					num_attention_heads
             _UpperCAmelCase  :						List[Any]							   =					intermediate_size
             _UpperCAmelCase  :						Any							   =					hidden_act
             _UpperCAmelCase  :						str							   =					hidden_dropout_prob
             _UpperCAmelCase  :						Union[str, Any]							   =					attention_probs_dropout_prob
             _UpperCAmelCase  :						Union[str, Any]							   =					initializer_range
             _UpperCAmelCase  :						Optional[int]							   =					layer_norm_eps
             _UpperCAmelCase  :						List[Any]							   =					qkv_bias
             _UpperCAmelCase  :						List[Any]							   =					use_mean_pooling

             _UpperCAmelCase  :						Optional[Any]							   =					decoder_num_attention_heads
             _UpperCAmelCase  :						int							   =					decoder_hidden_size
             _UpperCAmelCase  :						Any							   =					decoder_num_hidden_layers
             _UpperCAmelCase  :						Tuple							   =					decoder_intermediate_size
             _UpperCAmelCase  :						int							   =					pixel_mask_ratio
             _UpperCAmelCase  :						List[str]							   =					audio_mask_ratio
             _UpperCAmelCase  :						Optional[int]							   =					audio_mask_type

             _UpperCAmelCase  :						Optional[int]							   =					task_matching
             _UpperCAmelCase  :						Dict							   =					task_mae
             _UpperCAmelCase  :						List[str]							   =					loss_type


'''simple docstring'''




import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__SCREAMING_SNAKE_CASE :  Optional[int]  =						logging.get_logger(__name__)

class 			lowerCamelCase_			(snake_case__					):
      '''simple docstring'''

      __UpperCamelCase:						List[Any]      			=		"speech-encoder-decoder"
      __UpperCamelCase:						Optional[int]      			=		True




      def __init__( self		:       Optional[int]		,      **A		:       Tuple ):
             super().__init__(**A )
             if "encoder" not in kwargs or "decoder" not in kwargs:
                    raise ValueError(
                        F"""A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and"""
                        F""" `decoder` sub-configurations are passed, but only {kwargs}""" )

             _UpperCAmelCase  :						Dict							   =					kwargs.pop("encoder" )
             _UpperCAmelCase  :						Any							   =					encoder_config.pop("model_type" )
             _UpperCAmelCase  :						str							   =					kwargs.pop("decoder" )
             _UpperCAmelCase  :						int							   =					decoder_config.pop("model_type" )

             _UpperCAmelCase  :						List[Any]							   =					AutoConfig.for_model(A		,      **A )
             _UpperCAmelCase  :						str							   =					AutoConfig.for_model(A		,      **A )
             _UpperCAmelCase  :						Optional[int]							   =					True




      @classmethod
      def   _A			( cls		:       int		,      A		:       PretrainedConfig		,      A		:       PretrainedConfig		,      **A		:       Dict ):
             logger.info("Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config" )
             _UpperCAmelCase  :						Any							   =					True
             _UpperCAmelCase  :						Union[str, Any]							   =					True

             return cls(encoder=encoder_config.to_dict()		,      decoder=decoder_config.to_dict()		,      **A )





      def   _A			( self		:       Tuple ):
             _UpperCAmelCase  :						List[str]							   =					copy.deepcopy(self.__dict__ )
             _UpperCAmelCase  :						Any							   =					self.encoder.to_dict()
             _UpperCAmelCase  :						Union[str, Any]							   =					self.decoder.to_dict()
             _UpperCAmelCase  :						Union[str, Any]							   =					self.__class__.model_type
             return output

