


'''simple docstring'''



import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
	from transformers import AutoModelForSeqaSeqLM, AutoTokenizer






@require_torch
@require_sentencepiece
@require_tokenizers
class 	UpperCamelCase__(       unittest.TestCase	):




				@slow
				def 					a__(		self      :			List[str]				)->					Tuple:

										"""simple docstring"""




										UpperCAmelCase					    =     AutoModelForSeqaSeqLM.from_pretrained('''google/mt5-small'''				,   return_dict=__lowerCAmelCase				).to(__lowerCAmelCase				)
										UpperCAmelCase					    =     AutoTokenizer.from_pretrained('''google/mt5-small'''				)

										UpperCAmelCase					    =     tokenizer('''Hello there'''				,   return_tensors='''pt'''				).input_ids
										UpperCAmelCase					    =     tokenizer('''Hi I am'''				,   return_tensors='''pt'''				).input_ids

										UpperCAmelCase					    =     model(input_ids.to(__lowerCAmelCase				)				,   labels=labels.to(__lowerCAmelCase				)				).loss
										UpperCAmelCase					    =     -(labels.shape[-1] * loss.item())

										UpperCAmelCase					    =     -84.9127
										self.assertTrue(abs(mtf_score - EXPECTED_SCORE				) < 1E-4				)









'''simple docstring'''



def 				lowerCamelCase__				(	A       :      int				,       A       :      int					):




						'''simple docstring'''






						return int(input_a == input_a == 0					)


def 				lowerCamelCase__				(	):




						'''simple docstring'''






						print('''Truth Table of NOR Gate:'''					)
						print('''|   Input 1   |  Input 2  | Output |'''					)
						print(f"""|      0      |    0      |  {nor_gate(0				,       0					)}     |"""					)
						print(f"""|      0      |    1      |  {nor_gate(0				,       1					)}     |"""					)
						print(f"""|      1      |    0      |  {nor_gate(1				,       0					)}     |"""					)
						print(f"""|      1      |    1      |  {nor_gate(1				,       1					)}     |"""					)


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()





