1. 13 Apr, 2020 1 commit
  2. 10 Apr, 2020 5 commits
    • Jin Young Sohn's avatar
    • Jin Young Sohn's avatar
      Add `run_glue_tpu.py` that trains models on TPUs (#3702) · 551b4505
      Jin Young Sohn authored
      * Initial commit to get BERT + run_glue.py on TPU
      
      * Add README section for TPU and address comments.
      
      * Cleanup TPU bits from run_glue.py (#3)
      
      TPU runner is currently implemented in:
      https://github.com/pytorch-tpu/transformers/blob/tpu/examples/run_glue_tpu.py.
      
      We plan to upstream this directly into `huggingface/transformers`
      (either `master` or `tpu`) branch once it's been more thoroughly tested.
      
      * Cleanup TPU bits from run_glue.py
      
      TPU runner is currently implemented in:
      https://github.com/pytorch-tpu/transformers/blob/tpu/examples/run_glue_tpu.py
      
      .
      
      We plan to upstream this directly into `huggingface/transformers`
      (either `master` or `tpu`) branch once it's been more thoroughly tested.
      
      * No need to call `xm.mark_step()` explicitly (#4)
      
      Since for gradient accumulation we're accumulating on batches from
      `ParallelLoader` instance which on next() marks the step itself.
      
      * Resolve R/W conflicts from multiprocessing (#5)
      
      * Add XLNet in list of models for `run_glue_tpu.py` (#6)
      
      * Add RoBERTa to list of models in TPU GLUE (#7)
      
      * Add RoBERTa and DistilBert to list of models in TPU GLUE (#8)
      
      * Use barriers to reduce duplicate work/resources (#9)
      
      * Shard eval dataset and aggregate eval metrics (#10)
      
      * Shard eval dataset and aggregate eval metrics
      
      Also, instead of calling `eval_loss.item()` every time do summation with
      tensors on device.
      
      * Change defaultdict to float
      
      * Reduce the pred, label tensors instead of metrics
      
      As brought up during review some metrics like f1 cannot be aggregated
      via averaging. GLUE task metrics depends largely on the dataset, so
      instead we sync the prediction and label tensors so that the metrics can
      be computed accurately on those instead.
      
      * Only use tb_writer from master (#11)
      
      * Apply huggingface black code formatting
      
      * Style
      
      * Remove `--do_lower_case` as example uses cased
      
      * Add option to specify tensorboard logdir
      
      This is needed for our testing framework which checks regressions
      against key metrics writtern by the summary writer.
      
      * Using configuration for `xla_device`
      
      * Prefix TPU specific comments.
      
      * num_cores clarification and namespace eval metrics
      
      * Cache features file under `args.cache_dir`
      
      Instead of under `args.data_dir`. This is needed as our test infra uses
      data_dir with a read-only filesystem.
      
      * Rename `run_glue_tpu` to `run_tpu_glue`
      Co-authored-by: default avatarLysandreJik <lysandre.debut@reseau.eseo.fr>
      551b4505
    • Julien Chaumond's avatar
    • Julien Chaumond's avatar
      [examples] Generate argparsers from type hints on dataclasses (#3669) · b169ac9c
      Julien Chaumond authored
      * [examples] Generate argparsers from type hints on dataclasses
      
      * [HfArgumentParser] way simpler API
      
      * Restore run_language_modeling.py for easier diff
      
      * [HfArgumentParser] final tweaks from code review
      b169ac9c
    • Julien Chaumond's avatar
      Big cleanup of `glue_convert_examples_to_features` (#3688) · f98d0ef2
      Julien Chaumond authored
      * Big cleanup of `glue_convert_examples_to_features`
      
      * Use batch_encode_plus
      
      * Cleaner wrapping of glue_convert_examples_to_features for TF
      
      @lysandrejik
      
      * Cleanup syntax, thanks to @mfuntowicz
      
      * Raise explicit error in case of user error
      f98d0ef2
  3. 07 Apr, 2020 3 commits
  4. 06 Apr, 2020 1 commit
    • Ethan Perez's avatar
      Fix RoBERTa/XLNet Pad Token in run_multiple_choice.py (#3631) · e52d1258
      Ethan Perez authored
      * Fix RoBERTa/XLNet Pad Token in run_multiple_choice.py
      
      `convert_examples_to_fes atures` sets `pad_token=0` by default, which is correct for BERT but incorrect for RoBERTa (`pad_token=1`) and XLNet (`pad_token=5`). I think the other arguments to `convert_examples_to_features` are correct, but it might be helpful if someone checked who is more familiar with this part of the codebase.
      
      * Simplifying change to match recent commits
      e52d1258
  5. 02 Apr, 2020 3 commits
  6. 01 Apr, 2020 1 commit
  7. 31 Mar, 2020 1 commit
  8. 30 Mar, 2020 3 commits
  9. 29 Mar, 2020 1 commit
  10. 27 Mar, 2020 4 commits
  11. 26 Mar, 2020 3 commits
  12. 25 Mar, 2020 1 commit
  13. 24 Mar, 2020 3 commits
  14. 23 Mar, 2020 1 commit
  15. 20 Mar, 2020 3 commits
  16. 19 Mar, 2020 3 commits
  17. 17 Mar, 2020 3 commits
    • J.P Lee's avatar
      Update examples/ner/run_ner.py to use AutoModel (#3305) · 2b60a26b
      J.P Lee authored
      * Update examples/ner/run_ner.py to use AutoModel
      
      * Fix missing code and apply `make style` command
      2b60a26b
    • Nathan Raw's avatar
      [WIP] Lightning glue example (#3290) · 930c9412
      Nathan Raw authored
      *  Alter base pl transformer to use automodels
      
      * 🐛 Add batch size env variable to function call
      
      * 💄 Apply black code style from Makefile
      
      * 🚚 Move lightning base out of ner directory
      
      *  Add lightning glue example
      
      * 💄 self
      
      * move _feature_file to base class
      
      *  Move eval logging to custom callback
      
      * 💄 Apply black code style
      
      * 🐛 Add parent to pythonpath, remove copy command
      
      * 🐛 Add missing max_length kwarg
      930c9412
    • Patrick von Platen's avatar
      [generate] do_sample default back to False (#3298) · e8f44af5
      Patrick von Platen authored
      * change do_samples back
      
      * None better default as boolean
      
      * adapt do_sample to True in test example
      
      * make style
      e8f44af5