
import tempfile
import unittest

from transformers import AutoModelForSeqaSeqLM, AutoTokenizer
from transformers.testing_utils import (
    is_torch_available,
    require_optimum,
    require_torch,
    slow,
)


if is_torch_available():
    import torch




@require_torch
@require_optimum
@slow
class 			UpperCAmelCase_     (					unittest.TestCase	):


  '''simple docstring'''







  def 				_lowercase				(					self     :					List[str]       )     ->      List[Any]:







    """simple docstring"""






    __magic_name__								=			"""hf-internal-testing/tiny-random-t5"""
    __magic_name__								=			AutoTokenizer.from_pretrained(UpperCamelCase__       )
    __magic_name__								=			AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__       )

    __magic_name__								=			tokenizer("""This is me"""     ,				return_tensors="""pt"""       )

    __magic_name__								=			model.to_bettertransformer()

    self.assertTrue(any("""BetterTransformer""" in mod.__class__.__name__ for _, mod in model.named_modules()       )       )

    __magic_name__								=			model.generate(**UpperCamelCase__       )

    __magic_name__								=			model.reverse_bettertransformer()

    self.assertFalse(any("""BetterTransformer""" in mod.__class__.__name__ for _, mod in model.named_modules()       )       )

    with tempfile.TemporaryDirectory() as tmpdirname:
      model.save_pretrained(UpperCamelCase__       )

      __magic_name__								=			AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__       )

      self.assertFalse(
          any("""BetterTransformer""" in mod.__class__.__name__ for _, mod in model_reloaded.named_modules()       )       )

      __magic_name__								=			model_reloaded.generate(**UpperCamelCase__       )
      self.assertTrue(torch.allclose(UpperCamelCase__     ,				UpperCamelCase__       )       )





  def 				_lowercase				(					self     :					List[str]       )     ->      Dict:







    """simple docstring"""






    __magic_name__								=			"""hf-internal-testing/tiny-random-t5"""
    __magic_name__								=			AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__       )

    __magic_name__								=			model.to_bettertransformer()

    with tempfile.TemporaryDirectory() as tmpdirname:
      with self.assertRaises(UpperCamelCase__       ):
        model.save_pretrained(UpperCamelCase__       )

      __magic_name__								=			model.reverse_bettertransformer()
      model.save_pretrained(UpperCamelCase__       )



def a__       (			A_=28123   ):






  '''simple docstring'''





  __magic_name__								=			[1] * (limit + 1)

  for i in range(2,	int(limit**0.5   ) + 1   ):
    sum_divs[i * i] += i
    for k in range(i + 1,	limit // i + 1   ):
      sum_divs[k * i] += k + i

  __magic_name__								=			set()
  __magic_name__								=			0

  for n in range(1,	limit + 1   ):
    if sum_divs[n] > n:
      abundants.add(A_   )

    if not any((n - a in abundants) for a in abundants   ):
      res += n

  return res


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

