1. 27 Dec, 2021 1 commit
    • Sylvain Gugger's avatar
      Doc styler v2 (#14950) · 87e6e4fe
      Sylvain Gugger authored
      * New doc styler
      
      * Fix issue with args at the start
      
      * Code sample fixes
      
      * Style code examples in MDX
      
      * Fix more patterns
      
      * Typo
      
      * Typo
      
      * More patterns
      
      * Do without black for now
      
      * Get more info in error
      
      * Docstring style
      
      * Re-enable check
      
      * Quality
      
      * Fix add_end_docstring decorator
      
      * Fix docstring
      87e6e4fe
  2. 23 Dec, 2021 1 commit
  3. 21 Dec, 2021 2 commits
  4. 22 Jun, 2021 1 commit
  5. 26 Apr, 2021 1 commit
  6. 10 Mar, 2021 1 commit
    • Philipp Schmid's avatar
      Extend trainer logging for sm (#10633) · 49c61a4a
      Philipp Schmid authored
      * renamed logging to hf_logging
      
      * changed logging from hf_logging to logging and loggin to native_logging
      
      * removed everything trying to fix import Trainer error
      
      * adding imports again
      
      * added custom add_handler function to logging.py
      
      * make style
      
      * added remove_handler
      
      * added another conditional to assert
      49c61a4a
  7. 13 Feb, 2021 1 commit
  8. 09 Feb, 2021 1 commit
  9. 05 Jan, 2021 1 commit
    • Stas Bekman's avatar
      [logging] autoflush (#9385) · 4aa8f6ad
      Stas Bekman authored
      This PR proposes to:
      
      * auto-flush `transformers` logging 
      
      When using logging for tracing signals from different parts of the code and which could be mixed with print debug this aids to get all the logging events synchronized. 
      
      I don't think this change will introduce any performance impacts.
      
      If it helps someone here is the code I used to sync `transformers` logging with various other debug prints.
      
      I was porting bart to MP and I needed to trace that the device switching happens correctly and I added a bunch of logger.info calls inside `modeling_bart.py` and also had some other helpers `print` debug messages which weren't logger based:
      
      ```
      
      # auto flush std streams
      from sys import stdout, stderr
      def stdout_write_flush(args, w=stderr.write): w(args); stderr.flush()
      def stderr_write_flush(args, w=stderr.write): w(args); stderr.flush()
      stdout.write = stdout_write_flush
      stderr.write = stderr_write_flush
      
      from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
      
      import logging
      import transformers.utils.logging
      import transformers.models.bart.modeling_bart
      
      # I wanted a shorter simpler format
      handlers = transformers.utils.logging._get_library_root_logger().handlers
      for handler in handlers:
          formatter = logging.Formatter("[%(funcName)s] %(message)s")
          handler.setFormatter(formatter)
      
      transformers.models.bart.modeling_bart.logger.setLevel(transformers.logging.INFO)
      ```
      
      @LysandreJik, @sgugger, @patrickvonplaten
      4aa8f6ad
  10. 26 Oct, 2020 1 commit
    • Sylvain Gugger's avatar
      Doc styling (#8067) · 08f534d2
      Sylvain Gugger authored
      * Important files
      
      * Styling them all
      
      * Revert "Styling them all"
      
      This reverts commit 7d029395fdae8513b8281cbc2a6c239f8093503e.
      
      * Syling them for realsies
      
      * Fix syntax error
      
      * Fix benchmark_utils
      
      * More fixes
      
      * Fix modeling auto and script
      
      * Remove new line
      
      * Fixes
      
      * More fixes
      
      * Fix more files
      
      * Style
      
      * Add FSMT
      
      * More fixes
      
      * More fixes
      
      * More fixes
      
      * More fixes
      
      * Fixes
      
      * More fixes
      
      * More fixes
      
      * Last fixes
      
      * Make sphinx happy
      08f534d2
  11. 24 Sep, 2020 1 commit
  12. 09 Sep, 2020 1 commit
  13. 01 Sep, 2020 1 commit
  14. 31 Aug, 2020 1 commit
  15. 26 Aug, 2020 1 commit