






"""simple docstring"""





import unittest

from transformers import ErnieMTokenizer
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


A__       :			List[str]=						get_tests_dir("""fixtures/spiece.model""")
@require_sentencepiece
@require_tokenizers
class  __lowerCamelCase     (	_a				,						unittest.TestCase	):
   a   :					Optional[Any]			    =ErnieMTokenizer
   a   :					Any			    =False
   a   :					List[Any]			    =True
   a   :					Tuple			    =False
   a   :					Optional[int]			    =False

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Union[str, Any]:
       super().setUp()

       # We have a SentencePiece fixture for testing
       UpperCamelCase__								=     ErnieMTokenizer(snake_case_			,					unk_token='<unk>'			,					pad_token='<pad>'   )
       tokenizer.save_pretrained(self.tmpdirname   )

   def     SCREAMING_SNAKE_CASE__			(       self			,					snake_case_   )		->							str:
       UpperCamelCase__								=     'this is a test'
       UpperCamelCase__								=     'this is a test'
       return input_text, output_text

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							str:
       UpperCamelCase__								=     '<pad>'
       UpperCamelCase__								=     0

       self.assertEqual(self.get_tokenizer()._convert_token_to_id(snake_case_   )			,					snake_case_   )
       self.assertEqual(self.get_tokenizer()._convert_id_to_token(snake_case_   )			,					snake_case_   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Any:
       UpperCamelCase__								=     list(self.get_tokenizer().get_vocab().keys()   )

       self.assertEqual(vocab_keys[0]			,					'<pad>'   )
       self.assertEqual(vocab_keys[1]			,					'<unk>'   )
       self.assertEqual(vocab_keys[-1]			,					'▁eloquent'   )
       self.assertEqual(len(snake_case_   )			,					3_0000   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							int:
       self.assertEqual(self.get_tokenizer().vocab_size			,					3_0000   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Any:
       if not self.test_rust_tokenizer:
           return

       UpperCamelCase__								=     self.get_tokenizer()
       UpperCamelCase__								=     self.get_rust_tokenizer()

       UpperCamelCase__								=     'I was born in 92000, and this is falsé.'

       UpperCamelCase__								=     tokenizer.tokenize(snake_case_   )
       UpperCamelCase__								=     rust_tokenizer.tokenize(snake_case_   )
       self.assertListEqual(snake_case_			,					snake_case_   )

       UpperCamelCase__								=     tokenizer.encode(snake_case_			,					add_special_tokens=snake_case_   )
       UpperCamelCase__								=     rust_tokenizer.encode(snake_case_			,					add_special_tokens=snake_case_   )
       self.assertListEqual(snake_case_			,					snake_case_   )

       UpperCamelCase__								=     self.get_rust_tokenizer()
       UpperCamelCase__								=     tokenizer.encode(snake_case_   )
       UpperCamelCase__								=     rust_tokenizer.encode(snake_case_   )
       self.assertListEqual(snake_case_			,					snake_case_   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Any:
       UpperCamelCase__								=     ErnieMTokenizer(snake_case_			,					do_lower_case=snake_case_			,					unk_token='<unk>'			,					pad_token='<pad>'   )

       UpperCamelCase__								=     tokenizer.tokenize('This is a test'   )
       self.assertListEqual(snake_case_			,					['▁this', '▁is', '▁a', '▁test']   )

       self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case_   )			,					[48, 25, 21, 1289]   )

       UpperCamelCase__								=     tokenizer.tokenize('I was born in 92000, and this is falsé.'   )
       # ErnieMTokenizer(paddlenlp implementation) outputs '9' instead of '_9' so to mimic that '_9' is changed to '9'
       self.assertListEqual(
           snake_case_			,					['▁i', '▁was', '▁born', '▁in', '9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', 'é', '.']   )
       UpperCamelCase__								=     tokenizer.convert_tokens_to_ids(snake_case_   )
       self.assertListEqual(snake_case_			,					[31, 23, 386, 19, 518, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]   )

       UpperCamelCase__								=     tokenizer.convert_ids_to_tokens(snake_case_   )
       self.assertListEqual(
           snake_case_			,					['▁i', '▁was', '▁born', '▁in', '9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '.']			,					)

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							List[str]:
       UpperCamelCase__								=     ErnieMTokenizer(snake_case_			,					unk_token='<unk>'			,					pad_token='<pad>'   )

       UpperCamelCase__								=     tokenizer.encode('sequence builders'   )
       UpperCamelCase__								=     tokenizer.encode('multi-sequence build'   )

       UpperCamelCase__								=     tokenizer.build_inputs_with_special_tokens(snake_case_   )
       UpperCamelCase__								=     tokenizer.build_inputs_with_special_tokens(snake_case_			,					snake_case_   )

       assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]
       assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + [
           tokenizer.sep_token_id
       ] + text_a + [tokenizer.sep_token_id]







   @slow
   def     SCREAMING_SNAKE_CASE__			(       self   )		->							int:
       # fmt: off
       UpperCamelCase__								=     {'input_ids': [[0, 1_1062, 8_2772, 7, 15, 8_2772, 538, 5_1529, 237, 1_7198, 1290, 206, 9, 21_5175, 1314, 136, 1_7198, 1290, 206, 9, 5_6359, 42, 12_2009, 9, 1_6466, 16, 8_7344, 4537, 9, 4717, 7_8381, 6, 15_9958, 7, 15, 2_4480, 618, 4, 527, 2_2693, 9, 304, 4, 2777, 2_4480, 9874, 4, 4_3523, 594, 4, 803, 1_8392, 3_3189, 18, 4, 4_3523, 2_4447, 5, 5, 5, 16, 100, 2_4955, 8_3658, 9626, 14_4057, 15, 839, 2_2335, 16, 136, 2_4955, 8_3658, 8_3479, 15, 3_9102, 724, 16, 678, 645, 6460, 1328, 4589, 42, 12_2009, 11_5774, 23, 3559, 1328, 4_6876, 7, 136, 5_3894, 1940, 4_2227, 4_1159, 1_7721, 823, 425, 4, 2_7512, 9_8722, 206, 136, 5531, 4970, 919, 1_7336, 5, 2], [0, 2_0080, 618, 83, 8_2775, 47, 479, 9, 1517, 73, 5_3894, 333, 8_0581, 11_0117, 1_8811, 5256, 1295, 51, 15_2526, 297, 7986, 390, 12_4416, 538, 3_5431, 214, 98, 1_5044, 2_5737, 136, 7108, 4_3701, 23, 756, 13_5355, 7, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 581, 6_3773, 11_9455, 6, 14_7797, 8_8203, 7, 645, 70, 21, 3285, 1_0269, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]}
       # fmt: on

       self.tokenizer_integration_test_util(
           expected_encoding=snake_case_			,					model_name='susnato/ernie-m-base_pytorch'			,					sequences=[
               'Transformers (formerly known as pytorch-transformers and pytorch-pretrained-bert) provides '
               'general-purpose architectures (BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet...) for Natural '
               'Language Understanding (NLU) and Natural Language Generation (NLG) with over32+ pretrained '
               'models in100+ languages and deep interoperability between Jax, PyTorch and TensorFlow.',
               'BERT is designed to pre-train deep bidirectional representations from unlabeled text by jointly '
               'conditioning on both left and right context in all layers.',
               'The quick brown fox jumps over the lazy dog.',
           ]			,					)












"""simple docstring"""





import tempfile
import unittest

import numpy as np

import transformers
from transformers import GPTaTokenizer, GPTNeoConfig, is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax, slow

from ...generation.test_flax_utils import FlaxGenerationTesterMixin
from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
  import jax
  import jax.numpy as jnp

  from transformers.modeling_flax_pytorch_utils import (
      convert_pytorch_state_dict_to_flax,
      load_flax_weights_in_pytorch_model,
  )
  from transformers.models.gpt_neo.modeling_flax_gpt_neo import FlaxGPTNeoForCausalLM, FlaxGPTNeoModel

if is_torch_available():
  import torch
class  __lowerCamelCase     :

   def __init__(       self			,					snake_case_			,					snake_case_=14			,					snake_case_=7			,					snake_case_=True			,					snake_case_=True			,					snake_case_=False			,					snake_case_=True			,					snake_case_=99			,					snake_case_=32			,					snake_case_=4			,					snake_case_=4			,					snake_case_=[[["global", "local"], 2]]			,					snake_case_=37			,					snake_case_="gelu"			,					snake_case_=0.1			,					snake_case_=0.1			,					snake_case_=512			,					snake_case_=7			,					snake_case_=0.02			,					)		->							Tuple:
       UpperCamelCase__								=     parent
       UpperCamelCase__								=     batch_size
       UpperCamelCase__								=     seq_length
       UpperCamelCase__								=     is_training
       UpperCamelCase__								=     use_input_mask
       UpperCamelCase__								=     use_token_type_ids
       UpperCamelCase__								=     use_labels
       UpperCamelCase__								=     vocab_size
       UpperCamelCase__								=     hidden_size
       UpperCamelCase__								=     num_hidden_layers
       UpperCamelCase__								=     num_attention_heads
       UpperCamelCase__								=     attention_types
       UpperCamelCase__								=     intermediate_size
       UpperCamelCase__								=     hidden_act
       UpperCamelCase__								=     hidden_dropout_prob
       UpperCamelCase__								=     attention_probs_dropout_prob
       UpperCamelCase__								=     max_position_embeddings
       UpperCamelCase__								=     window_size
       UpperCamelCase__								=     initializer_range
       UpperCamelCase__								=     None
       UpperCamelCase__								=     vocab_size - 1
       UpperCamelCase__								=     vocab_size - 1
       UpperCamelCase__								=     vocab_size - 1

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Dict:
       UpperCamelCase__								=     ids_tensor([self.batch_size, self.seq_length]			,					self.vocab_size   )

       UpperCamelCase__								=     None
       if self.use_input_mask:
           UpperCamelCase__								=     random_attention_mask([self.batch_size, self.seq_length]   )

       UpperCamelCase__								=     GPTNeoConfig(
           vocab_size=self.vocab_size			,					hidden_size=self.hidden_size			,					num_layers=self.num_hidden_layers			,					num_heads=self.num_attention_heads			,					max_position_embeddings=self.max_position_embeddings			,					use_cache=snake_case_			,					bos_token_id=self.bos_token_id			,					eos_token_id=self.eos_token_id			,					pad_token_id=self.pad_token_id			,					window_size=self.window_size			,					attention_types=self.attention_types			,					)

       return (config, input_ids, input_mask)

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Tuple:
       UpperCamelCase__								=     self.prepare_config_and_inputs()
       UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__								=     config_and_inputs
       UpperCamelCase__								=     {'input_ids': input_ids, 'attention_mask': attention_mask}
       return config, inputs_dict

   def     SCREAMING_SNAKE_CASE__			(       self			,					snake_case_			,					snake_case_			,					snake_case_			,					snake_case_   )		->							Union[str, Any]:
       UpperCamelCase__								=     20
       UpperCamelCase__								=     model_class_name(snake_case_   )

       UpperCamelCase__								=     model.init_cache(input_ids.shape[0]			,					snake_case_   )
       UpperCamelCase__								=     jnp.ones((input_ids.shape[0], max_decoder_length)			,					dtype='i4'   )

       UpperCamelCase__								=     jnp.broadcast_to(
           jnp.arange(input_ids.shape[-1] - 1   )[None, :]			,					(input_ids.shape[0], input_ids.shape[-1] - 1)   )
       UpperCamelCase__								=     model(
           input_ids[:, :-1]			,					attention_mask=snake_case_			,					past_key_values=snake_case_			,					position_ids=snake_case_			,					)

       UpperCamelCase__								=     jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]			,					dtype='i4'   )
       UpperCamelCase__								=     model(
           input_ids[:, -1:]			,					attention_mask=snake_case_			,					past_key_values=outputs_cache.past_key_values			,					position_ids=snake_case_			,					)

       UpperCamelCase__								=     model(snake_case_   )

       UpperCamelCase__								=     np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])   )   )
       self.parent.assertTrue(diff < 1E-3			,					msg=F'Max diff is {diff}'   )







   def     SCREAMING_SNAKE_CASE__			(       self			,					snake_case_			,					snake_case_			,					snake_case_			,					snake_case_   )		->							List[str]:
       UpperCamelCase__								=     20
       UpperCamelCase__								=     model_class_name(snake_case_   )

       UpperCamelCase__								=     jnp.concatenate(
           [attention_mask, jnp.zeros((attention_mask.shape[0], max_decoder_length - attention_mask.shape[1])   )]			,					axis=-1			,					)

       UpperCamelCase__								=     model.init_cache(input_ids.shape[0]			,					snake_case_   )
       UpperCamelCase__								=     jnp.broadcast_to(
           jnp.arange(input_ids.shape[-1] - 1   )[None, :]			,					(input_ids.shape[0], input_ids.shape[-1] - 1)   )

       UpperCamelCase__								=     model(
           input_ids[:, :-1]			,					attention_mask=snake_case_			,					past_key_values=snake_case_			,					position_ids=snake_case_			,					)
       UpperCamelCase__								=     jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]			,					dtype='i4'   )
       UpperCamelCase__								=     model(
           input_ids[:, -1:]			,					past_key_values=outputs_cache.past_key_values			,					attention_mask=snake_case_			,					position_ids=snake_case_			,					)

       UpperCamelCase__								=     model(snake_case_			,					attention_mask=snake_case_   )

       UpperCamelCase__								=     np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])   )   )
       self.parent.assertTrue(diff < 1E-3			,					msg=F'Max diff is {diff}'   )







@require_flax
class  __lowerCamelCase     (	_a				,						_a				,						unittest.TestCase	):
   a   :					int			    =(FlaxGPTNeoModel, FlaxGPTNeoForCausalLM) if is_flax_available() else ()
   a   :					Optional[Any]			    =(FlaxGPTNeoForCausalLM,) if is_flax_available() else ()

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Dict:
       UpperCamelCase__								=     FlaxGPTNeoModelTester(self   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Tuple:
       for model_class_name in self.all_model_classes:
           UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__								=     self.model_tester.prepare_config_and_inputs()
           self.model_tester.check_use_cache_forward(snake_case_			,					snake_case_			,					snake_case_			,					snake_case_   )

   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Optional[int]:
       for model_class_name in self.all_model_classes:
           UpperCamelCase__							,    UpperCamelCase__							,    UpperCamelCase__								=     self.model_tester.prepare_config_and_inputs()
           self.model_tester.check_use_cache_forward_with_attn_mask(
               snake_case_			,					snake_case_			,					snake_case_			,					snake_case_   )

   @slow
   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Tuple:
       UpperCamelCase__								=     GPTaTokenizer.from_pretrained('gpt2'			,					pad_token='<|endoftext|>'			,					padding_side='left'   )
       UpperCamelCase__								=     tokenizer(['Hello this is a long string', 'Hey']			,					return_tensors='np'			,					padding=snake_case_			,					truncation=snake_case_   )

       UpperCamelCase__								=     FlaxGPTNeoForCausalLM.from_pretrained('EleutherAI/gpt-neo-125M'   )
       UpperCamelCase__								=     False
       UpperCamelCase__								=     model.config.eos_token_id

       UpperCamelCase__								=     jax.jit(model.generate   )

       UpperCamelCase__								=     jit_generate(
           inputs['input_ids']			,					attention_mask=inputs['attention_mask']			,					pad_token_id=tokenizer.pad_token_id   ).sequences

       UpperCamelCase__								=     tokenizer.batch_decode(snake_case_			,					skip_special_tokens=snake_case_   )

       UpperCamelCase__								=     [
           'Hello this is a long string of text.\n\nI\'m trying to get the text of the',
           'Hey, I\'m a little late to the party. I\'m going to',
       ]

       self.assertListEqual(snake_case_			,					snake_case_   )

   @is_pt_flax_cross_test
   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Optional[Any]:
       UpperCamelCase__							,    UpperCamelCase__								=     self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__   ):
               # prepare inputs
               UpperCamelCase__								=     self._prepare_for_class(snake_case_			,					snake_case_   )
               UpperCamelCase__								=     {k: torch.tensor(v.tolist()   ) for k, v in prepared_inputs_dict.items()}

               # load corresponding PyTorch class
               UpperCamelCase__								=     model_class.__name__[4:]  # Skip the "Flax" at the beginning
               UpperCamelCase__								=     getattr(snake_case_			,					snake_case_   )

               UpperCamelCase__							,    UpperCamelCase__								=     pt_inputs['input_ids'].shape
               UpperCamelCase__								=     np.random.randint(0			,					seq_length - 1			,					size=(batch_size,)   )
               for batch_idx, start_index in enumerate(snake_case_   ):
                   UpperCamelCase__								=     0
                   UpperCamelCase__								=     1
                   UpperCamelCase__								=     0
                   UpperCamelCase__								=     1
               UpperCamelCase__								=     pt_model_class(snake_case_   ).eval()
               UpperCamelCase__								=     model_class(snake_case_			,					dtype=jnp.floataa   )

               UpperCamelCase__								=     convert_pytorch_state_dict_to_flax(pt_model.state_dict()			,					snake_case_   )
               UpperCamelCase__								=     fx_state

               with torch.no_grad():
                   UpperCamelCase__								=     pt_model(**snake_case_   ).to_tuple()

               UpperCamelCase__								=     fx_model(**snake_case_   ).to_tuple()
               self.assertEqual(len(snake_case_   )			,					len(snake_case_   )			,					'Output lengths differ between Flax and PyTorch'   )
               for fx_output, pt_output in zip(snake_case_			,					snake_case_   ):
                   self.assert_almost_equals(fx_output[:, -1]			,					pt_output[:, -1].numpy()			,					4E-2   )

               with tempfile.TemporaryDirectory() as tmpdirname:
                   pt_model.save_pretrained(snake_case_   )
                   UpperCamelCase__								=     model_class.from_pretrained(snake_case_			,					from_pt=snake_case_   )

               UpperCamelCase__								=     fx_model_loaded(**snake_case_   ).to_tuple()
               self.assertEqual(
                   len(snake_case_   )			,					len(snake_case_   )			,					'Output lengths differ between Flax and PyTorch'   )
               for fx_output_loaded, pt_output in zip(snake_case_			,					snake_case_   ):
                   self.assert_almost_equals(fx_output_loaded[:, -1]			,					pt_output[:, -1].numpy()			,					4E-2   )

   @is_pt_flax_cross_test
   def     SCREAMING_SNAKE_CASE__			(       self   )		->							List[Any]:
       UpperCamelCase__							,    UpperCamelCase__								=     self.model_tester.prepare_config_and_inputs_for_common()
       for model_class in self.all_model_classes:
           with self.subTest(model_class.__name__   ):
               # prepare inputs
               UpperCamelCase__								=     self._prepare_for_class(snake_case_			,					snake_case_   )
               UpperCamelCase__								=     {k: torch.tensor(v.tolist()   ) for k, v in prepared_inputs_dict.items()}

               # load corresponding PyTorch class
               UpperCamelCase__								=     model_class.__name__[4:]  # Skip the "Flax" at the beginning
               UpperCamelCase__								=     getattr(snake_case_			,					snake_case_   )

               UpperCamelCase__								=     pt_model_class(snake_case_   ).eval()
               UpperCamelCase__								=     model_class(snake_case_			,					dtype=jnp.floataa   )

               UpperCamelCase__								=     load_flax_weights_in_pytorch_model(snake_case_			,					fx_model.params   )
               UpperCamelCase__							,    UpperCamelCase__								=     pt_inputs['input_ids'].shape
               UpperCamelCase__								=     np.random.randint(0			,					seq_length - 1			,					size=(batch_size,)   )
               for batch_idx, start_index in enumerate(snake_case_   ):
                   UpperCamelCase__								=     0
                   UpperCamelCase__								=     1
                   UpperCamelCase__								=     0
                   UpperCamelCase__								=     1

               # make sure weights are tied in PyTorch
               pt_model.tie_weights()

               with torch.no_grad():
                   UpperCamelCase__								=     pt_model(**snake_case_   ).to_tuple()

               UpperCamelCase__								=     fx_model(**snake_case_   ).to_tuple()
               self.assertEqual(len(snake_case_   )			,					len(snake_case_   )			,					'Output lengths differ between Flax and PyTorch'   )
               for fx_output, pt_output in zip(snake_case_			,					snake_case_   ):
                   self.assert_almost_equals(fx_output[:, -1]			,					pt_output[:, -1].numpy()			,					4E-2   )

               with tempfile.TemporaryDirectory() as tmpdirname:
                   fx_model.save_pretrained(snake_case_   )
                   UpperCamelCase__								=     pt_model_class.from_pretrained(snake_case_			,					from_flax=snake_case_   )

               with torch.no_grad():
                   UpperCamelCase__								=     pt_model_loaded(**snake_case_   ).to_tuple()

               self.assertEqual(
                   len(snake_case_   )			,					len(snake_case_   )			,					'Output lengths differ between Flax and PyTorch'   )
               for fx_output, pt_output in zip(snake_case_			,					snake_case_   ):
                   self.assert_almost_equals(fx_output[:, -1]			,					pt_output[:, -1].numpy()			,					4E-2   )







   @slow
   def     SCREAMING_SNAKE_CASE__			(       self   )		->							Optional[int]:
       for model_class_name in self.all_model_classes:
           UpperCamelCase__								=     model_class_name.from_pretrained('EleutherAI/gpt-neo-125M'   )
           UpperCamelCase__								=     model(np.ones((1, 1)   )   )
           self.assertIsNotNone(snake_case_   )




