

'''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 					A__      (      unittest.TestCase			):



    @slow
    def 					snake_case_			(					self       )						->      int:





           '''simple docstring'''
           A_						=      AutoModelForSeqaSeqLM.from_pretrained("""google/mt5-small"""		,				return_dict=UpperCamelCase__       ).to(UpperCamelCase__       )
           A_						=      AutoTokenizer.from_pretrained("""google/mt5-small"""       )

           A_						=      tokenizer("""Hello there"""		,				return_tensors="""pt"""       ).input_ids
           A_						=      tokenizer("""Hi I am"""		,				return_tensors="""pt"""       ).input_ids

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

           A_						=      -84.9127
           self.assertTrue(abs(mtf_score - EXPECTED_SCORE       ) < 1e-4       )



'''simple docstring'''







def       UpperCAmelCase__    (      UpperCAmelCase__				)			->			bool:
       return str(UpperCAmelCase__				) == str(UpperCAmelCase__				)[::-1]
def       UpperCAmelCase__    (      UpperCAmelCase__				)			->			int:
       return int(UpperCAmelCase__				) + int(str(UpperCAmelCase__				)[::-1]				)
def       UpperCAmelCase__    (      UpperCAmelCase__ = 1_00_00				)			->			int:
       A_						=      []
       for num in range(1,       UpperCAmelCase__				):
              A_						=      0
              A_						=      num
              while iterations < 50:
                     A_						=      sum_reverse(UpperCAmelCase__				)
                     iterations += 1
                     if is_palindrome(UpperCAmelCase__				):
                            break
              else:
                     lychrel_nums.append(UpperCAmelCase__				)
       return len(UpperCAmelCase__				)


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