1. 07 Feb, 2023 1 commit
    • Adrian Sager La Ganga's avatar
      Add inverse sqrt learning rate scheduler (#21495) · a3034c70
      Adrian Sager La Ganga authored
      * added inverse sqrt lr scheduler
      
      * Updated get_scheduler in src/transformers/optimization.py
      
      * Updated src/transformers/__init__.py
      
      * Added inverse sqrt lr scheduler test
      
      * Updated docs/source/en/main_classes/optimizer_schedules.mdx
      
      * Ran style and quality scripts
      
      * Fix get_inverse_sqrt_schedule docstring
      
      * Comment implementation URL
      a3034c70
  2. 06 Feb, 2023 1 commit
    • Sylvain Gugger's avatar
      Update quality tooling for formatting (#21480) · 6f79d264
      Sylvain Gugger authored
      * Result of black 23.1
      
      * Update target to Python 3.7
      
      * Switch flake8 to ruff
      
      * Configure isort
      
      * Configure isort
      
      * Apply isort with line limit
      
      * Put the right black version
      
      * adapt black in check copies
      
      * Fix copies
      6f79d264
  3. 23 Feb, 2022 1 commit
  4. 14 Jun, 2021 1 commit
  5. 07 Dec, 2020 1 commit
  6. 27 Aug, 2020 3 commits
  7. 11 Aug, 2020 1 commit
  8. 10 Aug, 2020 1 commit
  9. 01 Jul, 2020 1 commit
  10. 06 Jan, 2020 2 commits
  11. 22 Dec, 2019 8 commits
  12. 21 Dec, 2019 1 commit
    • Aymeric Augustin's avatar
      Reformat source code with black. · fa84ae26
      Aymeric Augustin authored
      This is the result of:
      
          $ black --line-length 119 examples templates transformers utils hubconf.py setup.py
      
      There's a lot of fairly long lines in the project. As a consequence, I'm
      picking the longest widely accepted line length, 119 characters.
      
      This is also Thomas' preference, because it allows for explicit variable
      names, to make the code easier to understand.
      fa84ae26
  13. 06 Dec, 2019 1 commit
    • Aymeric Augustin's avatar
      Remove dependency on pytest for running tests (#2055) · 35401fe5
      Aymeric Augustin authored
      * Switch to plain unittest for skipping slow tests.
      
      Add a RUN_SLOW environment variable for running them.
      
      * Switch to plain unittest for PyTorch dependency.
      
      * Switch to plain unittest for TensorFlow dependency.
      
      * Avoid leaking open files in the test suite.
      
      This prevents spurious warnings when running tests.
      
      * Fix unicode warning on Python 2 when running tests.
      
      The warning was:
      
          UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
      
      * Support running PyTorch tests on a GPU.
      
      Reverts 27e015bd.
      
      * Tests no longer require pytest.
      
      * Make tests pass on cuda
      35401fe5
  14. 14 Nov, 2019 1 commit
    • R茅mi Louf's avatar
      replace LambdaLR scheduler wrappers by function · 022525b0
      R茅mi Louf authored
      Custom schedulers are currently initiated by wrapping Pytorch's LambdaLR
      class and passing a method of the wrapping class to the __init__
      function of LambdaLR. This approach is not appropriate for several
      reasons:
      
      1. one does not need to define a class when it only defines a
      __init__() method;
      2. instantiating the parent class by passing a method of the child class
      creates a cyclical reference which leads to memory leaks. See issues #1742 and #1134.
      
      In this commit we replace the wrapper classes with functions that
      instantiate `LambdaLR` with a custom learning rate function. We use a
      closure to specify the parameter of the latter. We also do a bit of
      renaming within the function to explicit the behaviour and removed
      docstrings that were subsequently not necessary.
      022525b0
  15. 26 Sep, 2019 1 commit
  16. 09 Sep, 2019 1 commit
  17. 08 Sep, 2019 1 commit
  18. 05 Sep, 2019 1 commit
  19. 23 Jul, 2019 1 commit
  20. 11 Jul, 2019 2 commits
  21. 05 Jul, 2019 1 commit
  22. 02 Jul, 2019 1 commit
  23. 25 Apr, 2019 2 commits
  24. 21 Apr, 2019 1 commit
  25. 03 Apr, 2019 4 commits