"""simple docstring"""


from __future__ import annotations

import unittest

from transformers import is_tf_available, is_torch_available
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, SMALL_MODEL_IDENTIFIER, is_pt_tf_cross_test, slow


if is_tf_available():
	from transformers import (
	    AutoConfig,
	    BertConfig,
	    GPTaConfig,
	    TaConfig,
	    TFAutoModel,
	    TFAutoModelForCausalLM,
	    TFAutoModelForMaskedLM,
	    TFAutoModelForPreTraining,
	    TFAutoModelForQuestionAnswering,
	    TFAutoModelForSeqaSeqLM,
	    TFAutoModelForSequenceClassification,
	    TFAutoModelWithLMHead,
	    TFBertForMaskedLM,
	    TFBertForPreTraining,
	    TFBertForQuestionAnswering,
	    TFBertForSequenceClassification,
	    TFBertModel,
	    TFGPTaLMHeadModel,
	    TFRobertaForMaskedLM,
	    TFTaForConditionalGeneration,
	)
	from transformers.models.bert.modeling_tf_bert import TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST
	from transformers.models.gpta.modeling_tf_gpta import TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
	from transformers.models.ta.modeling_tf_ta import TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST

if is_torch_available():
	from transformers import (
	    AutoModel,
	    AutoModelForCausalLM,
	    AutoModelForMaskedLM,
	    AutoModelForPreTraining,
	    AutoModelForQuestionAnswering,
	    AutoModelForSeqaSeqLM,
	    AutoModelForSequenceClassification,
	    AutoModelWithLMHead,
	    BertForMaskedLM,
	    BertForPreTraining,
	    BertForQuestionAnswering,
	    BertForSequenceClassification,
	    BertModel,
	    GPTaLMHeadModel,
	    RobertaForMaskedLM,
	    TaForConditionalGeneration,
	)



@is_pt_tf_cross_test
class 			lowerCamelCase__						(   unittest.TestCase			):







						@slow
						def __a						(							self   :    str		):







								for model_name in ["bert-base-uncased"]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModel.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModel.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    int		):







								for model_name in ["bert-base-uncased"]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForPreTraining.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForPreTraining.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    List[Any]		):







								for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForCausalLM.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										A       , A					       = TFAutoModelForCausalLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForCausalLM.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										A       , A					       = AutoModelForCausalLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    List[str]		):







								for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    Optional[int]		):







								for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForMaskedLM.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										A       , A					       = TFAutoModelForMaskedLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForMaskedLM.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										A       , A					       = AutoModelForMaskedLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    Optional[Any]		):







								for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForSeqaSeqLM.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										A       , A					       = TFAutoModelForSeqaSeqLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForSeqaSeqLM.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										A       , A					       = AutoModelForSeqaSeqLM.from_pretrained(
										    lowerCAmelCase_			,			output_loading_info=lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    Optional[int]		):







								for model_name in ["bert-base-uncased"]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForSequenceClassification.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForSequenceClassification.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						@slow
						def __a						(							self   :    Any		):







								for model_name in ["bert-base-uncased"]:
										A					       = AutoConfig.from_pretrained(lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = TFAutoModelForQuestionAnswering.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)

										A					       = AutoModelForQuestionAnswering.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
										self.assertIsNotNone(lowerCAmelCase_		)
										self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)







						def __a						(							self   :    List[str]		):
								A					       = TFAutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
								self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)
								self.assertEqual(model.num_parameters()			,			14_410		)
								self.assertEqual(model.num_parameters(only_trainable=lowerCAmelCase_		)			,			14_410		)

								A					       = AutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
								self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)
								self.assertEqual(model.num_parameters()			,			14_410		)
								self.assertEqual(model.num_parameters(only_trainable=lowerCAmelCase_		)			,			14_410		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = TFAutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_pt=lowerCAmelCase_		)
								self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)
								self.assertEqual(model.num_parameters()			,			14_410		)
								self.assertEqual(model.num_parameters(only_trainable=lowerCAmelCase_		)			,			14_410		)

								A					       = AutoModelWithLMHead.from_pretrained(lowerCAmelCase_			,			from_tf=lowerCAmelCase_		)
								self.assertIsInstance(lowerCAmelCase_			,			lowerCAmelCase_		)
								self.assertEqual(model.num_parameters()			,			14_410		)
								self.assertEqual(model.num_parameters(only_trainable=lowerCAmelCase_		)			,			14_410		)









"""simple docstring"""


from __future__ import annotations







def  __snake_case       (   UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		if not nums:
				return 0
		A					       = nums[0]
		A					       = 0
		for num in nums[1:]:
				A       , A					       = (
				    max_excluding + num,
				    max(UpperCamelCase__ ,			UpperCamelCase__	),
				)
		return max(UpperCamelCase__ ,			UpperCamelCase__	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()





