





"""simple docstring"""
import copy

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


_snake_case	:						Union[str, Any]					=					logging.get_logger(__name__)






class    _UpperCAmelCase  (      a_					):
					UpperCamelCase						=				'''speech-encoder-decoder'''
					UpperCamelCase						=				True


					def __init__(   self     :Union[str, Any]	,			**__UpperCamelCase     :List[str]						):
												super().__init__(**snake_case__						)
												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}"						)

												A						=    kwargs.pop("encoder"						)
												A						=    encoder_config.pop("model_type"						)
												A						=    kwargs.pop("decoder"						)
												A						=    decoder_config.pop("model_type"						)

												A						=    AutoConfig.for_model(snake_case__	,			**snake_case__						)
												A						=    AutoConfig.for_model(snake_case__	,			**snake_case__						)
												A						=    True


					@classmethod
					def       lowerCamelCase			(   cls     :Union[str, Any]	,			__UpperCamelCase     :Union[str, Any]	,			__UpperCamelCase     :List[str]	,			**__UpperCamelCase     :Tuple						):
												logger.info("Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"						)
												A						=    True
												A						=    True

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


					def       lowerCamelCase			(   self     :Union[str, Any]						):
												A						=    copy.deepcopy(self.__dict__						)
												A						=    self.encoder.to_dict()
												A						=    self.decoder.to_dict()
												A						=    self.__class__.model_type
												return output







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase :				List[Any]							={"""configuration_qdqbert""": ["""QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """QDQBertConfig"""]}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase :				Dict							=[
	    """QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """QDQBertForMaskedLM""",
	    """QDQBertForMultipleChoice""",
	    """QDQBertForNextSentencePrediction""",
	    """QDQBertForQuestionAnswering""",
	    """QDQBertForSequenceClassification""",
	    """QDQBertForTokenClassification""",
	    """QDQBertLayer""",
	    """QDQBertLMHeadModel""",
	    """QDQBertModel""",
	    """QDQBertPreTrainedModel""",
	    """load_tf_weights_in_qdqbert""",
	]


if TYPE_CHECKING:
	from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_qdqbert import (
		    QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    QDQBertForMaskedLM,
		    QDQBertForMultipleChoice,
		    QDQBertForNextSentencePrediction,
		    QDQBertForQuestionAnswering,
		    QDQBertForSequenceClassification,
		    QDQBertForTokenClassification,
		    QDQBertLayer,
		    QDQBertLMHeadModel,
		    QDQBertModel,
		    QDQBertPreTrainedModel,
		    load_tf_weights_in_qdqbert,
		)


else:
	import sys

	UpperCAmelCase :				Optional[Any]							=_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
