






'''simple docstring'''







from __future__ import annotations

import unittest

from transformers import DebertaConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
			import tensorflow as tf

			from transformers import (
			    TFDebertaForMaskedLM,
			    TFDebertaForQuestionAnswering,
			    TFDebertaForSequenceClassification,
			    TFDebertaForTokenClassification,
			    TFDebertaModel,
			)

class _lowercase      :




							def __init__(				self:							Any     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							List[str]=13     ,				UpperCamelCase__:							Any=7     ,				UpperCamelCase__:							Optional[int]=True     ,				UpperCamelCase__:							Optional[Any]=True     ,				UpperCamelCase__:							Optional[int]=True     ,				UpperCamelCase__:							List[str]=True     ,				UpperCamelCase__:							Any=99     ,				UpperCamelCase__:							int=32     ,				UpperCamelCase__:							Optional[Any]=2     ,				UpperCamelCase__:							Tuple=4     ,				UpperCamelCase__:							Any=37     ,				UpperCamelCase__:							List[Any]="gelu"     ,				UpperCamelCase__:							Optional[int]=0.1     ,				UpperCamelCase__:							Optional[Any]=0.1     ,				UpperCamelCase__:							str=512     ,				UpperCamelCase__:							Tuple=16     ,				UpperCamelCase__:							str=2     ,				UpperCamelCase__:							Tuple=0.02     ,				UpperCamelCase__:							int=3     ,				UpperCamelCase__:							int=4     ,				UpperCamelCase__:							List[str]=None     ,				):
														lowerCamelCase__   :      List[str]			    =			parent
														lowerCamelCase__   :      List[str]			    =			13
														lowerCamelCase__   :      Union[str, Any]			    =			7
														lowerCamelCase__   :      str			    =			True
														lowerCamelCase__   :      Dict			    =			True
														lowerCamelCase__   :      Optional[int]			    =			True
														lowerCamelCase__   :      str			    =			True
														lowerCamelCase__   :      Union[str, Any]			    =			99
														lowerCamelCase__   :      int			    =			32
														lowerCamelCase__   :      Dict			    =			2
														lowerCamelCase__   :      Optional[Any]			    =			4
														lowerCamelCase__   :      Optional[Any]			    =			37
														lowerCamelCase__   :      Tuple			    =			'gelu'
														lowerCamelCase__   :      Union[str, Any]			    =			0.1
														lowerCamelCase__   :      List[Any]			    =			0.1
														lowerCamelCase__   :      Any			    =			512
														lowerCamelCase__   :      Tuple			    =			16
														lowerCamelCase__   :      Any			    =			False
														lowerCamelCase__   :      Optional[int]			    =			-1
														lowerCamelCase__   :      int			    =			True
														lowerCamelCase__   :      str			    =			2
														lowerCamelCase__   :      List[Any]			    =			0.02
														lowerCamelCase__   :      str			    =			3
														lowerCamelCase__   :      Optional[int]			    =			4
														lowerCamelCase__   :      Tuple			    =			None




							def 						lowerCamelCase_							(				self:							List[Any]	):
														lowerCamelCase__   :      Dict			    =			ids_tensor([self.batch_size, self.seq_length]     ,				self.vocab_size	)

														lowerCamelCase__   :      List[str]			    =			None
														if self.use_input_mask:
																					lowerCamelCase__   :      Union[str, Any]			    =			random_attention_mask([self.batch_size, self.seq_length]	)

														lowerCamelCase__   :      Dict			    =			None
														if self.use_token_type_ids:
																					lowerCamelCase__   :      Tuple			    =			ids_tensor([self.batch_size, self.seq_length]     ,				self.type_vocab_size	)

														lowerCamelCase__   :      Optional[Any]			    =			None
														lowerCamelCase__   :      Any			    =			None
														lowerCamelCase__   :      Tuple			    =			None
														if self.use_labels:
																					lowerCamelCase__   :      Tuple			    =			ids_tensor([self.batch_size]     ,				self.type_sequence_label_size	)
																					lowerCamelCase__   :      Tuple			    =			ids_tensor([self.batch_size, self.seq_length]     ,				self.num_labels	)

														lowerCamelCase__   :      List[Any]			    =			DebertaConfig(
														    vocab_size=self.vocab_size     ,				hidden_size=self.hidden_size     ,				num_hidden_layers=self.num_hidden_layers     ,				num_attention_heads=self.num_attention_heads     ,				intermediate_size=self.intermediate_size     ,				hidden_act=self.hidden_act     ,				hidden_dropout_prob=self.hidden_dropout_prob     ,				attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,				max_position_embeddings=self.max_position_embeddings     ,				type_vocab_size=self.type_vocab_size     ,				relative_attention=self.relative_attention     ,				max_relative_positions=self.max_relative_positions     ,				position_biased_input=self.position_biased_input     ,				initializer_range=self.initializer_range     ,				return_dict=__UpperCAmelCase     ,				)

														return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels




							def 						lowerCamelCase_							(				self:							List[Any]     ,				UpperCamelCase__:							int     ,				UpperCamelCase__:							str     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Optional[Any]     ,				UpperCamelCase__:							Optional[Any]     ,				UpperCamelCase__:							List[Any]	):
														lowerCamelCase__   :      Tuple			    =			TFDebertaModel(config=__UpperCAmelCase	)
														lowerCamelCase__   :      List[Any]			    =			{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}

														lowerCamelCase__   :      Dict			    =			[input_ids, input_mask]
														lowerCamelCase__   :      Union[str, Any]			    =			model(__UpperCAmelCase	)

														lowerCamelCase__   :      Dict			    =			model(__UpperCAmelCase	)

														self.parent.assertEqual(result.last_hidden_state.shape     ,				(self.batch_size, self.seq_length, self.hidden_size)	)




							def 						lowerCamelCase_							(				self:							Any     ,				UpperCamelCase__:							List[str]     ,				UpperCamelCase__:							List[str]     ,				UpperCamelCase__:							List[Any]     ,				UpperCamelCase__:							Optional[int]     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Union[str, Any]	):
														lowerCamelCase__   :      Optional[int]			    =			TFDebertaForMaskedLM(config=__UpperCAmelCase	)
														lowerCamelCase__   :      Optional[Any]			    =			{
														    'input_ids': input_ids,
														    'attention_mask': input_mask,
														    'token_type_ids': token_type_ids,
														}
														lowerCamelCase__   :      int			    =			model(__UpperCAmelCase	)
														self.parent.assertEqual(result.logits.shape     ,				(self.batch_size, self.seq_length, self.vocab_size)	)




							def 						lowerCamelCase_							(				self:							List[str]     ,				UpperCamelCase__:							Union[str, Any]     ,				UpperCamelCase__:							Any     ,				UpperCamelCase__:							Optional[Any]     ,				UpperCamelCase__:							Dict     ,				UpperCamelCase__:							Optional[Any]     ,				UpperCamelCase__:							Optional[int]     ,				UpperCamelCase__:							int	):
														lowerCamelCase__   :      List[Any]			    =			self.num_labels
														lowerCamelCase__   :      Dict			    =			TFDebertaForSequenceClassification(config=__UpperCAmelCase	)
														lowerCamelCase__   :      Dict			    =			{
														    'input_ids': input_ids,
														    'attention_mask': input_mask,
														    'token_type_ids': token_type_ids,
														}

														lowerCamelCase__   :      Optional[int]			    =			model(__UpperCAmelCase	)
														self.parent.assertEqual(result.logits.shape     ,				(self.batch_size, self.num_labels)	)




							def 						lowerCamelCase_							(				self:							Dict     ,				UpperCamelCase__:							Any     ,				UpperCamelCase__:							List[str]     ,				UpperCamelCase__:							Dict     ,				UpperCamelCase__:							Any     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Union[str, Any]     ,				UpperCamelCase__:							Dict	):
														lowerCamelCase__   :      Union[str, Any]			    =			self.num_labels
														lowerCamelCase__   :      str			    =			TFDebertaForTokenClassification(config=__UpperCAmelCase	)
														lowerCamelCase__   :      Dict			    =			{
														    'input_ids': input_ids,
														    'attention_mask': input_mask,
														    'token_type_ids': token_type_ids,
														}
														lowerCamelCase__   :      Union[str, Any]			    =			model(__UpperCAmelCase	)
														self.parent.assertEqual(result.logits.shape     ,				(self.batch_size, self.seq_length, self.num_labels)	)




							def 						lowerCamelCase_							(				self:							Tuple     ,				UpperCamelCase__:							Tuple     ,				UpperCamelCase__:							Any     ,				UpperCamelCase__:							int     ,				UpperCamelCase__:							int     ,				UpperCamelCase__:							List[str]     ,				UpperCamelCase__:							int     ,				UpperCamelCase__:							int	):
														lowerCamelCase__   :      int			    =			TFDebertaForQuestionAnswering(config=__UpperCAmelCase	)
														lowerCamelCase__   :      Optional[Any]			    =			{
														    'input_ids': input_ids,
														    'attention_mask': input_mask,
														    'token_type_ids': token_type_ids,
														}

														lowerCamelCase__   :      List[str]			    =			model(__UpperCAmelCase	)
														self.parent.assertEqual(result.start_logits.shape     ,				(self.batch_size, self.seq_length)	)
														self.parent.assertEqual(result.end_logits.shape     ,				(self.batch_size, self.seq_length)	)




							def 						lowerCamelCase_							(				self:							int	):
														lowerCamelCase__   :      Union[str, Any]			    =			self.prepare_config_and_inputs()
														(
														    lowerCamelCase__ 
														)   :      Optional[Any]			    =			config_and_inputs
														lowerCamelCase__   :      Union[str, Any]			    =			{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
														return config, inputs_dict



@require_tf
class _lowercase      (							_UpperCAmelCase							, _UpperCAmelCase							, unittest.TestCase						):
							a							 =			(
							    (
							        TFDebertaModel,
							        TFDebertaForMaskedLM,
							        TFDebertaForQuestionAnswering,
							        TFDebertaForSequenceClassification,
							        TFDebertaForTokenClassification,
							    )
							    if is_tf_available()
							    else ()
							)
							a							 =			(
							    {
							        "feature-extraction": TFDebertaModel,
							        "fill-mask": TFDebertaForMaskedLM,
							        "question-answering": TFDebertaForQuestionAnswering,
							        "text-classification": TFDebertaForSequenceClassification,
							        "token-classification": TFDebertaForTokenClassification,
							        "zero-shot": TFDebertaForSequenceClassification,
							    }
							    if is_tf_available()
							    else {}
							)

							a							 =			False
							a							 =			False




							def 						lowerCamelCase_							(				self:							Optional[Any]	):
														lowerCamelCase__   :      str			    =			TFDebertaModelTester(self	)
														lowerCamelCase__   :      Optional[int]			    =			ConfigTester(self     ,				config_class=__UpperCAmelCase     ,				hidden_size=37	)




							def 						lowerCamelCase_							(				self:							Any	):
														self.config_tester.run_common_tests()




							def 						lowerCamelCase_							(				self:							int	):
														lowerCamelCase__   :      str			    =			self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_model(*__UpperCAmelCase	)




							def 						lowerCamelCase_							(				self:							Union[str, Any]	):
														lowerCamelCase__   :      Tuple			    =			self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_masked_lm(*__UpperCAmelCase	)




							def 						lowerCamelCase_							(				self:							Optional[Any]	):
														lowerCamelCase__   :      int			    =			self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_question_answering(*__UpperCAmelCase	)




							def 						lowerCamelCase_							(				self:							List[str]	):
														lowerCamelCase__   :      Dict			    =			self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_sequence_classification(*__UpperCAmelCase	)




							def 						lowerCamelCase_							(				self:							str	):
														lowerCamelCase__   :      Any			    =			self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_token_classification(*__UpperCAmelCase	)




							@slow
							def 						lowerCamelCase_							(				self:							Tuple	):
														lowerCamelCase__   :      Tuple			    =			TFDebertaModel.from_pretrained("""kamalkraj/deberta-base"""	)
														self.assertIsNotNone(__UpperCAmelCase	)



@require_tf
class _lowercase      (							unittest.TestCase						):




							@unittest.skip(reason="""Model not available yet"""	)
							def 						lowerCamelCase_							(				self:							int	):
														pass




							@slow
							def 						lowerCamelCase_							(				self:							Union[str, Any]	):
														lowerCamelCase__   :      Tuple			    =			TFDebertaModel.from_pretrained("""kamalkraj/deberta-base"""	)
														lowerCamelCase__   :      Optional[int]			    =			tf.constant([[0, 31_414, 232, 328, 740, 1_140, 12_695, 69, 46_078, 1_588, 2]]	)
														lowerCamelCase__   :      str			    =			tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]	)
														lowerCamelCase__   :      Tuple			    =			model(__UpperCAmelCase     ,				attention_mask=__UpperCAmelCase	)[0]

														lowerCamelCase__   :      Any			    =			tf.constant(
														    [
														        [
														            [-0.59_855_896, -0.80_552_566, -0.8_462_135],
														            [1.4_484_025, -0.93_483_794, -0.80_593_085],
														            [0.3_122_741, 0.00_316_059, -1.4_131_377],
														        ]
														    ]	)
														tf.debugging.assert_near(output[:, 1:4, 1:4]     ,				__UpperCAmelCase     ,				atol=1e-4	)





"""simple docstring"""






from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE__				:  int						= {
    "auto_factory": ["get_values"],
    "configuration_auto": ["ALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CONFIG_MAPPING", "MODEL_NAMES_MAPPING", "AutoConfig"],
    "feature_extraction_auto": ["FEATURE_EXTRACTOR_MAPPING", "AutoFeatureExtractor"],
    "image_processing_auto": ["IMAGE_PROCESSOR_MAPPING", "AutoImageProcessor"],
    "processing_auto": ["PROCESSOR_MAPPING", "AutoProcessor"],
    "tokenization_auto": ["TOKENIZER_MAPPING", "AutoTokenizer"],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE__				:  Optional[int]						= [
     "MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING",
     "MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING",
     "MODEL_FOR_AUDIO_XVECTOR_MAPPING",
     "MODEL_FOR_BACKBONE_MAPPING",
     "MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING",
     "MODEL_FOR_CAUSAL_LM_MAPPING",
     "MODEL_FOR_CTC_MAPPING",
     "MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING",
     "MODEL_FOR_DEPTH_ESTIMATION_MAPPING",
     "MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING",
     "MODEL_FOR_IMAGE_SEGMENTATION_MAPPING",
     "MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING",
     "MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING",
     "MODEL_FOR_MASKED_LM_MAPPING",
     "MODEL_FOR_MASK_GENERATION_MAPPING",
     "MODEL_FOR_MULTIPLE_CHOICE_MAPPING",
     "MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING",
     "MODEL_FOR_OBJECT_DETECTION_MAPPING",
     "MODEL_FOR_PRETRAINING_MAPPING",
     "MODEL_FOR_QUESTION_ANSWERING_MAPPING",
     "MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING",
     "MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING",
     "MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING",
     "MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING",
     "MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING",
     "MODEL_FOR_TEXT_ENCODING_MAPPING",
     "MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING",
     "MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING",
     "MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING",
     "MODEL_FOR_VISION_2_SEQ_MAPPING",
     "MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING",
     "MODEL_MAPPING",
     "MODEL_WITH_LM_HEAD_MAPPING",
     "MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING",
     "MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING",
     "AutoModel",
     "AutoBackbone",
     "AutoModelForAudioClassification",
     "AutoModelForAudioFrameClassification",
     "AutoModelForAudioXVector",
     "AutoModelForCausalLM",
     "AutoModelForCTC",
     "AutoModelForDepthEstimation",
     "AutoModelForImageClassification",
     "AutoModelForImageSegmentation",
     "AutoModelForInstanceSegmentation",
     "AutoModelForMaskGeneration",
     "AutoModelForTextEncoding",
     "AutoModelForMaskedImageModeling",
     "AutoModelForMaskedLM",
     "AutoModelForMultipleChoice",
     "AutoModelForNextSentencePrediction",
     "AutoModelForObjectDetection",
     "AutoModelForPreTraining",
     "AutoModelForQuestionAnswering",
     "AutoModelForSemanticSegmentation",
     "AutoModelForSeq2SeqLM",
     "AutoModelForSequenceClassification",
     "AutoModelForSpeechSeq2Seq",
     "AutoModelForTableQuestionAnswering",
     "AutoModelForTokenClassification",
     "AutoModelForUniversalSegmentation",
     "AutoModelForVideoClassification",
     "AutoModelForVision2Seq",
     "AutoModelForVisualQuestionAnswering",
     "AutoModelForDocumentQuestionAnswering",
     "AutoModelWithLMHead",
     "AutoModelForZeroShotImageClassification",
     "AutoModelForZeroShotObjectDetection",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE__				:  int						= [
     "TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING",
     "TF_MODEL_FOR_CAUSAL_LM_MAPPING",
     "TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING",
     "TF_MODEL_FOR_MASK_GENERATION_MAPPING",
     "TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING",
     "TF_MODEL_FOR_MASKED_LM_MAPPING",
     "TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING",
     "TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING",
     "TF_MODEL_FOR_PRETRAINING_MAPPING",
     "TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING",
     "TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING",
     "TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING",
     "TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING",
     "TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING",
     "TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING",
     "TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING",
     "TF_MODEL_FOR_TEXT_ENCODING_MAPPING",
     "TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING",
     "TF_MODEL_FOR_VISION_2_SEQ_MAPPING",
     "TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING",
     "TF_MODEL_MAPPING",
     "TF_MODEL_WITH_LM_HEAD_MAPPING",
     "TFAutoModel",
     "TFAutoModelForAudioClassification",
     "TFAutoModelForCausalLM",
     "TFAutoModelForImageClassification",
     "TFAutoModelForMaskedImageModeling",
     "TFAutoModelForMaskedLM",
     "TFAutoModelForMaskGeneration",
     "TFAutoModelForMultipleChoice",
     "TFAutoModelForNextSentencePrediction",
     "TFAutoModelForPreTraining",
     "TFAutoModelForDocumentQuestionAnswering",
     "TFAutoModelForQuestionAnswering",
     "TFAutoModelForSemanticSegmentation",
     "TFAutoModelForSeq2SeqLM",
     "TFAutoModelForSequenceClassification",
     "TFAutoModelForSpeechSeq2Seq",
     "TFAutoModelForTableQuestionAnswering",
     "TFAutoModelForTextEncoding",
     "TFAutoModelForTokenClassification",
     "TFAutoModelForVision2Seq",
     "TFAutoModelForZeroShotImageClassification",
     "TFAutoModelWithLMHead",
 ]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE__				:  Optional[int]						= [
     "FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING",
     "FLAX_MODEL_FOR_CAUSAL_LM_MAPPING",
     "FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING",
     "FLAX_MODEL_FOR_MASKED_LM_MAPPING",
     "FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING",
     "FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING",
     "FLAX_MODEL_FOR_PRETRAINING_MAPPING",
     "FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING",
     "FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING",
     "FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING",
     "FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING",
     "FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING",
     "FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING",
     "FLAX_MODEL_MAPPING",
     "FlaxAutoModel",
     "FlaxAutoModelForCausalLM",
     "FlaxAutoModelForImageClassification",
     "FlaxAutoModelForMaskedLM",
     "FlaxAutoModelForMultipleChoice",
     "FlaxAutoModelForNextSentencePrediction",
     "FlaxAutoModelForPreTraining",
     "FlaxAutoModelForQuestionAnswering",
     "FlaxAutoModelForSeq2SeqLM",
     "FlaxAutoModelForSequenceClassification",
     "FlaxAutoModelForSpeechSeq2Seq",
     "FlaxAutoModelForTokenClassification",
     "FlaxAutoModelForVision2Seq",
 ]


if TYPE_CHECKING:
 from .auto_factory import get_values
 from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig
 from .feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING, AutoFeatureExtractor
 from .image_processing_auto import IMAGE_PROCESSOR_MAPPING, AutoImageProcessor
 from .processing_auto import PROCESSOR_MAPPING, AutoProcessor
 from .tokenization_auto import TOKENIZER_MAPPING, AutoTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_auto import (
      MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
      MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING,
      MODEL_FOR_AUDIO_XVECTOR_MAPPING,
      MODEL_FOR_BACKBONE_MAPPING,
      MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING,
      MODEL_FOR_CAUSAL_LM_MAPPING,
      MODEL_FOR_CTC_MAPPING,
      MODEL_FOR_DEPTH_ESTIMATION_MAPPING,
      MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING,
      MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
      MODEL_FOR_IMAGE_SEGMENTATION_MAPPING,
      MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING,
      MODEL_FOR_MASK_GENERATION_MAPPING,
      MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING,
      MODEL_FOR_MASKED_LM_MAPPING,
      MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
      MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
      MODEL_FOR_OBJECT_DETECTION_MAPPING,
      MODEL_FOR_PRETRAINING_MAPPING,
      MODEL_FOR_QUESTION_ANSWERING_MAPPING,
      MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING,
      MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
      MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
      MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
      MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
      MODEL_FOR_TEXT_ENCODING_MAPPING,
      MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
      MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING,
      MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING,
      MODEL_FOR_VISION_2_SEQ_MAPPING,
      MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING,
      MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING,
      MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING,
      MODEL_MAPPING,
      MODEL_WITH_LM_HEAD_MAPPING,
      AutoBackbone,
      AutoModel,
      AutoModelForAudioClassification,
      AutoModelForAudioFrameClassification,
      AutoModelForAudioXVector,
      AutoModelForCausalLM,
      AutoModelForCTC,
      AutoModelForDepthEstimation,
      AutoModelForDocumentQuestionAnswering,
      AutoModelForImageClassification,
      AutoModelForImageSegmentation,
      AutoModelForInstanceSegmentation,
      AutoModelForMaskedImageModeling,
      AutoModelForMaskedLM,
      AutoModelForMaskGeneration,
      AutoModelForMultipleChoice,
      AutoModelForNextSentencePrediction,
      AutoModelForObjectDetection,
      AutoModelForPreTraining,
      AutoModelForQuestionAnswering,
      AutoModelForSemanticSegmentation,
      AutoModelForSeqaSeqLM,
      AutoModelForSequenceClassification,
      AutoModelForSpeechSeqaSeq,
      AutoModelForTableQuestionAnswering,
      AutoModelForTextEncoding,
      AutoModelForTokenClassification,
      AutoModelForUniversalSegmentation,
      AutoModelForVideoClassification,
      AutoModelForVisionaSeq,
      AutoModelForVisualQuestionAnswering,
      AutoModelForZeroShotImageClassification,
      AutoModelForZeroShotObjectDetection,
      AutoModelWithLMHead,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_auto import (
      TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
      TF_MODEL_FOR_CAUSAL_LM_MAPPING,
      TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING,
      TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
      TF_MODEL_FOR_MASK_GENERATION_MAPPING,
      TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING,
      TF_MODEL_FOR_MASKED_LM_MAPPING,
      TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
      TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
      TF_MODEL_FOR_PRETRAINING_MAPPING,
      TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING,
      TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING,
      TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
      TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
      TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
      TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
      TF_MODEL_FOR_TEXT_ENCODING_MAPPING,
      TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
      TF_MODEL_FOR_VISION_2_SEQ_MAPPING,
      TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING,
      TF_MODEL_MAPPING,
      TF_MODEL_WITH_LM_HEAD_MAPPING,
      TFAutoModel,
      TFAutoModelForAudioClassification,
      TFAutoModelForCausalLM,
      TFAutoModelForDocumentQuestionAnswering,
      TFAutoModelForImageClassification,
      TFAutoModelForMaskedImageModeling,
      TFAutoModelForMaskedLM,
      TFAutoModelForMaskGeneration,
      TFAutoModelForMultipleChoice,
      TFAutoModelForNextSentencePrediction,
      TFAutoModelForPreTraining,
      TFAutoModelForQuestionAnswering,
      TFAutoModelForSemanticSegmentation,
      TFAutoModelForSeqaSeqLM,
      TFAutoModelForSequenceClassification,
      TFAutoModelForSpeechSeqaSeq,
      TFAutoModelForTableQuestionAnswering,
      TFAutoModelForTextEncoding,
      TFAutoModelForTokenClassification,
      TFAutoModelForVisionaSeq,
      TFAutoModelForZeroShotImageClassification,
      TFAutoModelWithLMHead,
  )

 try:
  if not is_flax_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_flax_auto import (
      FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
      FLAX_MODEL_FOR_CAUSAL_LM_MAPPING,
      FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
      FLAX_MODEL_FOR_MASKED_LM_MAPPING,
      FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
      FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
      FLAX_MODEL_FOR_PRETRAINING_MAPPING,
      FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING,
      FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
      FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
      FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
      FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
      FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING,
      FLAX_MODEL_MAPPING,
      FlaxAutoModel,
      FlaxAutoModelForCausalLM,
      FlaxAutoModelForImageClassification,
      FlaxAutoModelForMaskedLM,
      FlaxAutoModelForMultipleChoice,
      FlaxAutoModelForNextSentencePrediction,
      FlaxAutoModelForPreTraining,
      FlaxAutoModelForQuestionAnswering,
      FlaxAutoModelForSeqaSeqLM,
      FlaxAutoModelForSequenceClassification,
      FlaxAutoModelForSpeechSeqaSeq,
      FlaxAutoModelForTokenClassification,
      FlaxAutoModelForVisionaSeq,
  )

else:
 import sys

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





