1. 25 Aug, 2020 1 commit
    • Joel Hanson's avatar
      Allow tests in examples to use cuda or fp16,if they are available (#5512) · 4db2fa77
      Joel Hanson authored
      * Allow tests in examples to use cuda or fp16,if they are available
      
      The tests in examples didn't use the cuda or fp16 even if they where available.
      - The text classification example (`run_glue.py`) didn't use the fp16 even if it was available but
        the device was take based on the availablity(cuda/cpu).
      - The language-modeling example (`run_language_modeling.py`) was having `--no_cuda` argument
        which made the test to work without cuda. This example is having issue when running with fp16
        thus it not enabled (got an assertion error for perplexity due to it higher value).
      - The cuda and fp16 is not enabled for question-answering example (`run_squad.py`) as it is having a
        difference in the f1 score.
      - The text-generation example (`run_generation.py`) will take the cuda or fp16 whenever it is available.
      
      Resolves some of: #5057
      
      * Unwanted import of is_apex_available was removed
      
      * Made changes to test examples file to have the pass --fp16 only if cuda and apex is avaliable
      - run_glue.py: Removed the check for cuda and fp16.
      - run_generation.py: Removed the check for cuda and fp16 also removed unwanted flag creation.
      
      * Incorrectly sorted imports fixed
      
      * The model needs to be converted to half precision
      
      * Formatted single line if condition statement to multiline
      
      * The torch_device also needed to be checked before running the test on examples
      - The tests in examples which uses cuda should also depend from the USE_CUDA flag,
        similarly to the rest of the test suite. Even if we decide to set USE_CUDA to
        True by default, setting USE_CUDA to False should result in the examples not using CUDA
      
      * Format some of the code in test_examples file
      
      * The improper import of is_apex_available was sorted
      
      * Formatted the code to keep the style standards
      
      * The comma at the end of list giving a flake8 issue was fixed
      
      * Import sort was fixed
      
      * Removed the clean_test_dir function as its not used right now
      4db2fa77
  2. 06 Jul, 2020 1 commit
  3. 07 May, 2020 1 commit
    • Julien Chaumond's avatar
      BIG Reorganize examples (#4213) · 0ae96ff8
      Julien Chaumond authored
      * Created using Colaboratory
      
      * [examples] reorganize files
      
      * remove run_tpu_glue.py as superseded by TPU support in Trainer
      
      * Bugfix: int, not tuple
      
      * move files around
      0ae96ff8
  4. 28 Apr, 2020 1 commit
  5. 02 Mar, 2020 1 commit
  6. 24 Feb, 2020 1 commit
  7. 21 Feb, 2020 1 commit
    • Patrick von Platen's avatar
      Improve special_token_id logic in run_generation.py and add tests (#2885) · fc38d4c8
      Patrick von Platen authored
      
      
      * improving generation
      
      * finalized special token behaviour for no_beam_search generation
      
      * solved modeling_utils merge conflict
      
      * solve merge conflicts in modeling_utils.py
      
      * add run_generation improvements from PR #2749
      
      * adapted language generation to not use hardcoded -1 if no padding token is available
      
      * remove the -1 removal as hard coded -1`s are not necessary anymore
      
      * add lightweight language generation testing for randomely initialized models - just checking whether no errors are thrown
      
      * add slow language generation tests for pretrained models using hardcoded output with pytorch seed
      
      * delete ipdb
      
      * check that all generated tokens are valid
      
      * renaming
      
      * renaming Generation -> Generate
      
      * make style
      
      * updated so that generate_beam_search has same token behavior than generate_no_beam_search
      
      * consistent return format for run_generation.py
      
      * deleted pretrain lm generate tests -> will be added in another PR
      
      * cleaning of unused if statements and renaming
      
      * run_generate will always return an iterable
      
      * make style
      
      * consistent renaming
      
      * improve naming, make sure generate function always returns the same tensor, add docstring
      
      * add slow tests for all lmhead models
      
      * make style and improve example comments modeling_utils
      
      * better naming and refactoring in modeling_utils
      
      * improving generation
      
      * finalized special token behaviour for no_beam_search generation
      
      * solved modeling_utils merge conflict
      
      * solve merge conflicts in modeling_utils.py
      
      * add run_generation improvements from PR #2749
      
      * adapted language generation to not use hardcoded -1 if no padding token is available
      
      * remove the -1 removal as hard coded -1`s are not necessary anymore
      
      * add lightweight language generation testing for randomely initialized models - just checking whether no errors are thrown
      
      * add slow language generation tests for pretrained models using hardcoded output with pytorch seed
      
      * delete ipdb
      
      * check that all generated tokens are valid
      
      * renaming
      
      * renaming Generation -> Generate
      
      * make style
      
      * updated so that generate_beam_search has same token behavior than generate_no_beam_search
      
      * consistent return format for run_generation.py
      
      * deleted pretrain lm generate tests -> will be added in another PR
      
      * cleaning of unused if statements and renaming
      
      * run_generate will always return an iterable
      
      * make style
      
      * consistent renaming
      
      * improve naming, make sure generate function always returns the same tensor, add docstring
      
      * add slow tests for all lmhead models
      
      * make style and improve example comments modeling_utils
      
      * better naming and refactoring in modeling_utils
      
      * changed fast random lm generation testing design to more general one
      
      * delete in old testing design in gpt2
      
      * correct old variable name
      
      * temporary fix for encoder_decoder lm generation tests - has to be updated when t5 is fixed
      
      * adapted all fast random generate tests to new design
      
      * better warning description in modeling_utils
      
      * better comment
      
      * better comment and error message
      Co-authored-by: default avatarThomas Wolf <thomwolf@users.noreply.github.com>
      fc38d4c8
  8. 31 Jan, 2020 2 commits
  9. 06 Jan, 2020 2 commits
  10. 22 Dec, 2019 3 commits
  11. 21 Dec, 2019 3 commits
  12. 18 Dec, 2019 1 commit
  13. 16 Dec, 2019 1 commit
  14. 10 Dec, 2019 1 commit
  15. 31 Oct, 2019 1 commit
  16. 22 Oct, 2019 2 commits
  17. 17 Oct, 2019 1 commit
  18. 10 Oct, 2019 2 commits
  19. 06 Oct, 2019 1 commit
  20. 04 Oct, 2019 1 commit
    • keskarnitish's avatar
      Adding CTRL (squashed commit) · dbed1c5d
      keskarnitish authored
      adding conversion script
      
      adding first draft of modeling & tokenization
      
      adding placeholder for test files
      
      bunch of changes
      
      registering the tokenizer/model/etc
      
      tests
      
      change link; something is very VERY wrong here
      
      weird end-of-word thingy going on
      
      i think the tokenization works now ; wrote the unit tests
      
      overall structure works;load w next
      
      the monster is alive!
      
      works after some cleanup as well
      
      adding emacs autosave to gitignore
      
      currently only supporting the 48 layer one; seems to infer fine on my macbook
      
      cleanup
      
      fixing some documentation
      
      fixing some documentation
      
      tests passing?
      
      now works on CUDA also
      
      adding greedy?
      
      adding greedy sampling
      
      works well
      dbed1c5d
  21. 03 Oct, 2019 2 commits
  22. 26 Sep, 2019 1 commit
  23. 25 Sep, 2019 1 commit
  24. 22 Sep, 2019 1 commit
  25. 15 Jul, 2019 1 commit
  26. 14 Jul, 2019 1 commit
  27. 13 Jul, 2019 1 commit