
import random
import unittest

import numpy as np

import transformers
from transformers import is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax


if is_flax_available():
					import os

					import jax.numpy as jnp
					from jax import jit

					from transformers import AutoTokenizer, FlaxAutoModelForCausalLM
					from transformers.modeling_flax_pytorch_utils import load_flax_weights_in_pytorch_model

					UpperCamelCase_ 						=						'''0.12'''  # assumed parallelism: 8


if is_torch_available():
					import torch






def 		_UpperCAmelCase (						UpperCamelCase:  List[str]      ,				UpperCamelCase:  Any      ,				UpperCamelCase:  Union[str, Any]=None	):






	"""simple docstring"""


	if rng is None:
		__lowerCAmelCase    =				random.Random()

	__lowerCAmelCase    =				1
	for dim in shape:
		total_dims *= dim

	__lowerCAmelCase    =				[]
	for _ in range(_lowercase	):
		values.append(rng.randint(0      ,				vocab_size - 1	)	)

	__lowerCAmelCase    =				np.array(_lowercase      ,				dtype=jnp.intaa	).reshape(_lowercase	)

	return output






def 		_UpperCAmelCase (						UpperCamelCase:  List[str]      ,				UpperCamelCase:  int=None	):






	"""simple docstring"""


	__lowerCAmelCase    =				ids_tensor(_lowercase      ,				vocab_size=2      ,				rng=_lowercase	)
	# make sure that at least one token is attended to for each batch
	__lowerCAmelCase    =				1
	return attn_mask

@require_flax
class    a		:
							lowercase_		:    Dict 				=	None
							lowercase_		:    List[Any] 				=	()







							def    UpperCAmelCase__       (    self	:	List[str]			):
								"""simple docstring"""







								__lowerCAmelCase    =				self.model_tester.prepare_config_and_inputs_for_common()

								# cut to half length & take max batch_size 3
								__lowerCAmelCase    =				2
								__lowerCAmelCase    =				inputs["input_ids"].shape[-1] // 2
								__lowerCAmelCase    =				inputs["input_ids"][:max_batch_size, :sequence_length]

								__lowerCAmelCase    =				jnp.ones_like(lowerCAmelCase__			)
								__lowerCAmelCase    =				attention_mask[:max_batch_size, :sequence_length]

								# generate max 5 tokens
								__lowerCAmelCase    =				input_ids.shape[-1] + 5
								if config.eos_token_id is not None and config.pad_token_id is None:
									# hack to allow generate for models such as GPT2 as is done in `generate()`
									__lowerCAmelCase    =				config.eos_token_id
								return config, input_ids, attention_mask, max_length







							@is_pt_flax_cross_test
							def    UpperCAmelCase__       (    self	:	Dict			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				False
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				0

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model_class.__name__[4:]  # Skip the "Flax" at the beginning
									__lowerCAmelCase    =				getattr(lowerCAmelCase__   ,					lowerCAmelCase__			)
									__lowerCAmelCase    =				pt_model_class(lowerCAmelCase__			).eval()
									__lowerCAmelCase    =				load_flax_weights_in_pytorch_model(lowerCAmelCase__   ,					flax_model.params			)

									__lowerCAmelCase    =				flax_model.generate(lowerCAmelCase__			).sequences
									__lowerCAmelCase    =				pt_model.generate(torch.tensor(lowerCAmelCase__   ,					dtype=torch.long			)			)

									if flax_generation_outputs.shape[-1] > pt_generation_outputs.shape[-1]:
										__lowerCAmelCase    =				flax_generation_outputs[:, : pt_generation_outputs.shape[-1]]

									self.assertListEqual(pt_generation_outputs.numpy().tolist()   ,					flax_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	int			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				False
								__lowerCAmelCase    =				max_length

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	str			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				True
								__lowerCAmelCase    =				max_length

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Any			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				False
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				2

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Dict			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				False
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				2
								__lowerCAmelCase    =				2

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[0]   ,					input_ids.shape[0] * config.num_return_sequences			)







							def    UpperCAmelCase__       (    self	:	Tuple			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				True
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				0.8
								__lowerCAmelCase    =				10
								__lowerCAmelCase    =				0.3
								__lowerCAmelCase    =				1
								__lowerCAmelCase    =				8
								__lowerCAmelCase    =				9

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Any			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				1
								__lowerCAmelCase    =				8
								__lowerCAmelCase    =				9

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Dict			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()
								__lowerCAmelCase    =				max_length
								__lowerCAmelCase    =				2
								__lowerCAmelCase    =				1
								__lowerCAmelCase    =				8
								__lowerCAmelCase    =				9

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Any			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()

								# pad attention mask on the left
								__lowerCAmelCase    =				attention_mask.at[(0, 0)].set(0			)

								__lowerCAmelCase    =				False
								__lowerCAmelCase    =				max_length

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	List[Any]			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()

								# pad attention mask on the left
								__lowerCAmelCase    =				attention_mask.at[(0, 0)].set(0			)

								__lowerCAmelCase    =				True
								__lowerCAmelCase    =				max_length

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)







							def    UpperCAmelCase__       (    self	:	Optional[Any]			):
								"""simple docstring"""







								__lowerCAmelCase    =				self._get_input_ids_and_config()

								# pad attention mask on the left
								__lowerCAmelCase    =				attention_mask.at[(0, 0)].set(0			)

								__lowerCAmelCase    =				2
								__lowerCAmelCase    =				max_length

								for model_class in self.all_generative_model_classes:
									__lowerCAmelCase    =				model_class(lowerCAmelCase__			)

									__lowerCAmelCase    =				model.generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences
									self.assertEqual(generation_outputs.shape[-1]   ,					lowerCAmelCase__			)

									__lowerCAmelCase    =				jit(model.generate			)
									__lowerCAmelCase    =				jit_generate(lowerCAmelCase__   ,					attention_mask=lowerCAmelCase__			).sequences

									self.assertListEqual(generation_outputs.tolist()   ,					jit_generation_outputs.tolist()			)

@require_flax
class    a		( unittest.TestCase       ):







							def    UpperCAmelCase__       (    self	:	Optional[Any]			):
								"""simple docstring"""







								__lowerCAmelCase    =				AutoTokenizer.from_pretrained("hf-internal-testing/tiny-bert"			)
								__lowerCAmelCase    =				FlaxAutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-bert-flax-only"			)

								__lowerCAmelCase    =				"Hello world"
								__lowerCAmelCase    =				tokenizer(lowerCAmelCase__   ,					return_tensors="np"			).input_ids

								# typos are quickly detected (the correct argument is `do_sample`)
								with self.assertRaisesRegex(lowerCAmelCase__   ,					"do_samples"			):
									model.generate(lowerCAmelCase__   ,					do_samples=lowerCAmelCase__			)

								# arbitrary arguments that will not be used anywhere are also not accepted
								with self.assertRaisesRegex(lowerCAmelCase__   ,					"foo"			):
									__lowerCAmelCase    =				{"foo": "bar"}
									model.generate(lowerCAmelCase__   ,					**lowerCAmelCase__			)













"""simple docstring"""




import gc
import unittest

from transformers import CTRLConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
		import torch

		from transformers import (
		    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
		    CTRLForSequenceClassification,
		    CTRLLMHeadModel,
		    CTRLModel,
		)


class 			__UpperCamelCase							:






							def __init__(  self ,   lowerCAmelCase__ ,   lowerCAmelCase__=14 ,   lowerCAmelCase__=7 ,   lowerCAmelCase__=True ,   lowerCAmelCase__=True ,   lowerCAmelCase__=True ,   lowerCAmelCase__=True ,   lowerCAmelCase__=True ,   lowerCAmelCase__=99 ,   lowerCAmelCase__=32 ,   lowerCAmelCase__=5 ,   lowerCAmelCase__=4 ,   lowerCAmelCase__=37 ,   lowerCAmelCase__="gelu" ,   lowerCAmelCase__=0.1 ,   lowerCAmelCase__=0.1 ,   lowerCAmelCase__=512 ,   lowerCAmelCase__=16 ,   lowerCAmelCase__=2 ,   lowerCAmelCase__=0.02 ,   lowerCAmelCase__=3 ,   lowerCAmelCase__=4 ,   lowerCAmelCase__=None ,   )      ->					Optional[int]:
								a :						Optional[int]      =							parent
								a :						Optional[int]      =							batch_size
								a :						str      =							seq_length
								a :						int      =							is_training
								a :						Union[str, Any]      =							use_token_type_ids
								a :						Tuple      =							use_input_mask
								a :						Optional[Any]      =							use_labels
								a :						str      =							use_mc_token_ids
								a :						str      =							vocab_size
								a :						str      =							hidden_size
								a :						List[Any]      =							num_hidden_layers
								a :						str      =							num_attention_heads
								a :						Tuple      =							intermediate_size
								a :						List[Any]      =							hidden_act
								a :						List[Any]      =							hidden_dropout_prob
								a :						List[str]      =							attention_probs_dropout_prob
								a :						Dict      =							max_position_embeddings
								a :						int      =							type_vocab_size
								a :						Any      =							type_sequence_label_size
								a :						List[Any]      =							initializer_range
								a :						List[str]      =							num_labels
								a :						Optional[int]      =							num_choices
								a :						int      =							scope
								a :						Tuple      =							self.vocab_size - 1






							def        __a  (  self )      ->					int:
								a :						Optional[Any]      =							ids_tensor([self.batch_size, self.seq_length] ,   self.vocab_size )

								a :						str      =							None
								if self.use_input_mask:
									a :						Dict      =							random_attention_mask([self.batch_size, self.seq_length] )

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

								a :						int      =							None
								if self.use_mc_token_ids:
									a :						Dict      =							ids_tensor([self.batch_size, self.num_choices] ,   self.seq_length )

								a :						List[Any]      =							None
								a :						Optional[int]      =							None
								a :						str      =							None
								if self.use_labels:
									a :						List[str]      =							ids_tensor([self.batch_size] ,   self.type_sequence_label_size )
									a :						List[str]      =							ids_tensor([self.batch_size, self.seq_length] ,   self.num_labels )
									a :						Any      =							ids_tensor([self.batch_size] ,   self.num_choices )

								a :						Tuple      =							self.get_config()

								a :						int      =							ids_tensor([self.num_hidden_layers, self.num_attention_heads] ,   2 )

								return (
								    config,
								    input_ids,
								    input_mask,
								    head_mask,
								    token_type_ids,
								    mc_token_ids,
								    sequence_labels,
								    token_labels,
								    choice_labels,
								)






							def        __a  (  self )      ->					Tuple:
								return CTRLConfig(
								    vocab_size=self.vocab_size ,   n_embd=self.hidden_size ,   n_layer=self.num_hidden_layers ,   n_head=self.num_attention_heads ,   n_positions=self.max_position_embeddings ,   pad_token_id=self.pad_token_id ,   )






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   *lowerCAmelCase__ )      ->					str:
								a :						Union[str, Any]      =							CTRLModel(config=lowerCAmelCase__ )
								model.to(lowerCAmelCase__ )
								model.eval()

								model(lowerCAmelCase__ ,   token_type_ids=lowerCAmelCase__ ,   head_mask=lowerCAmelCase__ )
								model(lowerCAmelCase__ ,   token_type_ids=lowerCAmelCase__ )
								a :						List[Any]      =							model(lowerCAmelCase__ )
								self.parent.assertEqual(result.last_hidden_state.shape ,   (self.batch_size, self.seq_length, self.hidden_size) )
								self.parent.assertEqual(len(result.past_key_values ) ,   config.n_layer )






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   *lowerCAmelCase__ )      ->					Optional[int]:
								a :						Tuple      =							CTRLLMHeadModel(lowerCAmelCase__ )
								model.to(lowerCAmelCase__ )
								model.eval()

								a :						List[str]      =							model(lowerCAmelCase__ ,   token_type_ids=lowerCAmelCase__ ,   labels=lowerCAmelCase__ )
								self.parent.assertEqual(result.loss.shape ,   () )
								self.parent.assertEqual(result.logits.shape ,   (self.batch_size, self.seq_length, self.vocab_size) )






							def        __a  (  self )      ->					Optional[int]:
								a :						Tuple      =							self.prepare_config_and_inputs()

								(
								    (
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			(
								    a
								),			
								) :						Optional[Any]      =							config_and_inputs

								a :						List[Any]      =							{"input_ids": input_ids, "token_type_ids": token_type_ids, "head_mask": head_mask}

								return config, inputs_dict






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   *lowerCAmelCase__ )      ->					Optional[Any]:
								a :						List[str]      =							self.num_labels
								a :						Union[str, Any]      =							CTRLForSequenceClassification(lowerCAmelCase__ )
								model.to(lowerCAmelCase__ )
								model.eval()
								a :						Optional[int]      =							ids_tensor([self.batch_size] ,   self.type_sequence_label_size )
								a :						Dict      =							model(lowerCAmelCase__ ,   token_type_ids=lowerCAmelCase__ ,   labels=lowerCAmelCase__ )
								self.parent.assertEqual(result.logits.shape ,   (self.batch_size, self.num_labels) )


@require_torch
class 			__UpperCamelCase							(		a__						,			a__						,			a__						,			unittest.TestCase		):
							lowerCamelCase  :   Tuple    =(CTRLModel, CTRLLMHeadModel, CTRLForSequenceClassification) if is_torch_available() else ()
							lowerCamelCase  :   List[Any]    =(CTRLLMHeadModel,) if is_torch_available() else ()
							lowerCamelCase  :   List[Any]    =(
							    {
							        """feature-extraction""": CTRLModel,
							        """text-classification""": CTRLForSequenceClassification,
							        """text-generation""": CTRLLMHeadModel,
							        """zero-shot""": CTRLForSequenceClassification,
							    }
							    if is_torch_available()
							    else {}
							)
							lowerCamelCase  :   Optional[int]    =True
							lowerCamelCase  :   List[str]    =False
							lowerCamelCase  :   Optional[Any]    =False






							def        __a  (  self ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ ,   lowerCAmelCase__ )      ->					Optional[int]:
								if pipeline_test_casse_name == "ZeroShotClassificationPipelineTests":
									# Get `tokenizer does not have a padding token` error for both fast/slow tokenizers.
									# `CTRLConfig` was never used in pipeline tests, either because of a missing checkpoint or because a tiny
									# config could not be created.
									return True

								return False






							def        __a  (  self )      ->					str:
								a :						str      =							CTRLModelTester(self )
								a :						Dict      =							ConfigTester(self ,   config_class=lowerCAmelCase__ ,   n_embd=37 )






							def        __a  (  self )      ->					Tuple:
								super().tearDown()
								# clean-up as much as possible GPU memory occupied by PyTorch
								gc.collect()
								torch.cuda.empty_cache()






							def        __a  (  self )      ->					Optional[Any]:
								self.config_tester.run_common_tests()






							def        __a  (  self )      ->					Union[str, Any]:
								a :						Optional[int]      =							self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_ctrl_model(*lowerCAmelCase__ )






							def        __a  (  self )      ->					int:
								a :						List[str]      =							self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_lm_head_model(*lowerCAmelCase__ )






							@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests." )
							def        __a  (  self )      ->					Tuple:
								pass






							@slow
							def        __a  (  self )      ->					Optional[Any]:
								for model_name in CTRL_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
									a :						Union[str, Any]      =							CTRLModel.from_pretrained(lowerCAmelCase__ )
									self.assertIsNotNone(lowerCAmelCase__ )






							@unittest.skip("The model doesn't support left padding" )  # and it's not used enough to be worth fixing :)
							def        __a  (  self )      ->					Tuple:
								pass


@require_torch
class 			__UpperCamelCase							(		unittest.TestCase		):






							def        __a  (  self )      ->					int:
								super().tearDown()
								# clean-up as much as possible GPU memory occupied by PyTorch
								gc.collect()
								torch.cuda.empty_cache()






							@slow
							def        __a  (  self )      ->					Dict:
								a :						Dict      =							CTRLLMHeadModel.from_pretrained("ctrl" )
								model.to(lowerCAmelCase__ )
								a :						List[str]      =							torch.tensor(
								    [[1_1859, 0, 1611, 8]] ,   dtype=torch.long ,   device=lowerCAmelCase__ )  # Legal the president is
								a :						Any      =							[
								    1_1859,
								    0,
								    1611,
								    8,
								    5,
								    150,
								    2_6449,
								    2,
								    19,
								    348,
								    469,
								    3,
								    2595,
								    48,
								    2_0740,
								    24_6533,
								    24_6533,
								    19,
								    30,
								    5,
								]  # Legal the president is a good guy and I don't want to lose my job. \n \n I have a

								a :						str      =							model.generate(lowerCAmelCase__ ,   do_sample=lowerCAmelCase__ )
								self.assertListEqual(output_ids[0].tolist() ,   lowerCAmelCase__ )


