


"""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 		snake_case_(       unittest.TestCase			):






     @slow
     def      lowerCamelCase__     (	self  :					Optional[Any]				):
           # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           for model_name in ["bert-base-uncased"]:
                 lowerCAmelCase					:	Any       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Optional[int]       =   TFAutoModel.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Dict       =   AutoModel.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					List[Any]				):
           # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           for model_name in ["bert-base-uncased"]:
                 lowerCAmelCase					:	Any       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Optional[Any]       =   TFAutoModelForPreTraining.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	int       =   AutoModelForPreTraining.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					Optional[Any]				):
           for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCAmelCase					:	int       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	str       =   TFAutoModelForCausalLM.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	Optional[Any]       =   TFAutoModelForCausalLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	str       =   AutoModelForCausalLM.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	Any       =   AutoModelForCausalLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					Optional[int]				):
           for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCAmelCase					:	List[str]       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Dict       =   TFAutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	str       =   AutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					Dict				):
           for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCAmelCase					:	Optional[int]       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Any       =   TFAutoModelForMaskedLM.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	Optional[int]       =   TFAutoModelForMaskedLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	str       =   AutoModelForMaskedLM.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	Optional[int]       =   AutoModelForMaskedLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					Any				):
           for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCAmelCase					:	str       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Any       =   TFAutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	str       =   TFAutoModelForSeqaSeqLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Any       =   AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 lowerCAmelCase,      lowerCAmelCase					:	int       =   AutoModelForSeqaSeqLM.from_pretrained(
                     UpperCamelCase_					,				output_loading_info=UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					int				):
           # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           for model_name in ["bert-base-uncased"]:
                 lowerCAmelCase					:	Tuple       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Any       =   TFAutoModelForSequenceClassification.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	List[str]       =   AutoModelForSequenceClassification.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     @slow
     def      lowerCamelCase__     (	self  :					List[Any]				):
           # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           for model_name in ["bert-base-uncased"]:
                 lowerCAmelCase					:	Optional[Any]       =   AutoConfig.from_pretrained(UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	Optional[Any]       =   TFAutoModelForQuestionAnswering.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)

                 lowerCAmelCase					:	str       =   AutoModelForQuestionAnswering.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
                 self.assertIsNotNone(UpperCamelCase_				)
                 self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)






     def      lowerCamelCase__     (	self  :					List[str]				):
           lowerCAmelCase					:	List[Any]       =   TFAutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
           self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)
           self.assertEqual(model.num_parameters()					,				1_4_4_1_0				)
           self.assertEqual(model.num_parameters(only_trainable=UpperCamelCase_				)					,				1_4_4_1_0				)

           lowerCAmelCase					:	List[Any]       =   AutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
           self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)
           self.assertEqual(model.num_parameters()					,				1_4_4_1_0				)
           self.assertEqual(model.num_parameters(only_trainable=UpperCamelCase_				)					,				1_4_4_1_0				)






     def      lowerCamelCase__     (	self  :					Dict				):
           lowerCAmelCase					:	Optional[int]       =   TFAutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_pt=UpperCamelCase_				)
           self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)
           self.assertEqual(model.num_parameters()					,				1_4_4_1_0				)
           self.assertEqual(model.num_parameters(only_trainable=UpperCamelCase_				)					,				1_4_4_1_0				)

           lowerCAmelCase					:	Tuple       =   AutoModelWithLMHead.from_pretrained(UpperCamelCase_					,				from_tf=UpperCamelCase_				)
           self.assertIsInstance(UpperCamelCase_					,				UpperCamelCase_				)
           self.assertEqual(model.num_parameters()					,				1_4_4_1_0				)
           self.assertEqual(model.num_parameters(only_trainable=UpperCamelCase_				)					,				1_4_4_1_0				)






"""simple docstring"""





def      _snake_case						(						_snake_case				:			int = 4000000			):
      lowerCAmelCase					:	int       =   [0, 1]
      lowerCAmelCase					:	List[str]       =   0
      while fib[i] <= n:
            fib.append(fib[i] + fib[i + 1]			)
            if fib[i + 2] > n:
                  break
            i += 1
      lowerCAmelCase					:	int       =   0
      for j in range(len(_snake_case			) - 1			):
            if fib[j] % 2 == 0:
                  total += fib[j]

      return total


if __name__ == "__main__":
 print(f"""{solution() = }""")


