

"""simple docstring"""
import unittest

from transformers import AutoConfig, AutoTokenizer, BertConfig, TensorType, is_flax_available
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, require_flax, slow


if is_flax_available():
    import jax

    from transformers.models.auto.modeling_flax_auto import FlaxAutoModel
    from transformers.models.bert.modeling_flax_bert import FlaxBertModel
    from transformers.models.roberta.modeling_flax_roberta import FlaxRobertaModel

@require_flax
class       lowerCamelCase	(       unittest.TestCase   ):


  '''simple docstring'''







  @slow
  def  _a      (self	):


        """simple docstring"""

        for model_name in ["bert-base-cased", "bert-large-uncased"]:
              with self.subTest(_lowerCamelCase	):
                    UpperCAmelCase__			:							Optional[Any]							=    AutoConfig.from_pretrained(_lowerCamelCase	)
                    self.assertIsNotNone(_lowerCamelCase	)
                    self.assertIsInstance(_lowerCamelCase							,       _lowerCamelCase	)

                    UpperCAmelCase__			:							str							=    FlaxAutoModel.from_pretrained(_lowerCamelCase	)
                    self.assertIsNotNone(_lowerCamelCase	)
                    self.assertIsInstance(_lowerCamelCase							,       _lowerCamelCase	)



  @slow
  def  _a      (self	):


        """simple docstring"""

        for model_name in ["roberta-base", "roberta-large"]:
              with self.subTest(_lowerCamelCase	):
                    UpperCAmelCase__			:							List[str]							=    AutoConfig.from_pretrained(_lowerCamelCase	)
                    self.assertIsNotNone(_lowerCamelCase	)
                    self.assertIsInstance(_lowerCamelCase							,       _lowerCamelCase	)

                    UpperCAmelCase__			:							str							=    FlaxAutoModel.from_pretrained(_lowerCamelCase	)
                    self.assertIsNotNone(_lowerCamelCase	)
                    self.assertIsInstance(_lowerCamelCase							,       _lowerCamelCase	)



  @slow
  def  _a      (self	):


        """simple docstring"""

        for model_name in ["bert-base-cased", "bert-large-uncased"]:
              UpperCAmelCase__			:							List[str]							=    AutoTokenizer.from_pretrained(_lowerCamelCase	)
              UpperCAmelCase__			:							List[str]							=    FlaxBertModel.from_pretrained(_lowerCamelCase	)
              UpperCAmelCase__			:							Optional[int]							=    tokenizer("""Do you support jax jitted function?"""							,       return_tensors=TensorType.JAX	)

              @jax.jit
              def eval(**_lowerCamelCase	):
                    return model(**_lowerCamelCase	)

              eval(**_lowerCamelCase	).block_until_ready()



  @slow
  def  _a      (self	):


        """simple docstring"""

        for model_name in ["roberta-base", "roberta-large"]:
              UpperCAmelCase__			:							Optional[int]							=    AutoTokenizer.from_pretrained(_lowerCamelCase	)
              UpperCAmelCase__			:							Optional[Any]							=    FlaxRobertaModel.from_pretrained(_lowerCamelCase	)
              UpperCAmelCase__			:							Dict							=    tokenizer("""Do you support jax jitted function?"""							,       return_tensors=TensorType.JAX	)

              @jax.jit
              def eval(**_lowerCamelCase	):
                    return model(**_lowerCamelCase	)

              eval(**_lowerCamelCase	).block_until_ready()



  def  _a      (self	):


        """simple docstring"""

        with self.assertRaisesRegex(
            _lowerCamelCase							,       """bert-base is not a local folder and is not a valid model identifier"""	):
              UpperCAmelCase__			:							List[str]							=    FlaxAutoModel.from_pretrained("""bert-base"""	)



  def  _a      (self	):


        """simple docstring"""

        with self.assertRaisesRegex(
            _lowerCamelCase							,       r"""aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)"""	):
              UpperCAmelCase__			:							str							=    FlaxAutoModel.from_pretrained(_lowerCamelCase							,       revision="""aaaaaa"""	)



  def  _a      (self	):


        """simple docstring"""

        with self.assertRaisesRegex(
            _lowerCamelCase							,       """hf-internal-testing/config-no-model does not appear to have a file named flax_model.msgpack"""							,       ):
              UpperCAmelCase__			:							Tuple							=    FlaxAutoModel.from_pretrained("""hf-internal-testing/config-no-model"""	)




  def  _a      (self	):


        """simple docstring"""

        with self.assertRaisesRegex(_lowerCamelCase							,       """Use `from_pt=True` to load this model"""	):
              UpperCAmelCase__			:							int							=    FlaxAutoModel.from_pretrained("""hf-internal-testing/tiny-bert-pt-only"""	)




"""simple docstring"""
def 					a__						(						)	-> Union[str, Any]:
      UpperCAmelCase__			:							Dict							=    []
      UpperCAmelCase__			:							Tuple							=    1

      while len(lowerCAmelCase    ) < 1E6:
            constant.append(str(lowerCAmelCase    )    )
            i += 1

      UpperCAmelCase__			:							Any							=    """""".join(lowerCAmelCase    )

      return (
          int(constant[0]    )
          * int(constant[9]    )
          * int(constant[99]    )
          * int(constant[9_99]    )
          * int(constant[99_99]    )
          * int(constant[9_99_99]    )
          * int(constant[99_99_99]    )
      )


if __name__ == "__main__":
    print(solution())

