1. 11 Jan, 2021 4 commits
    • Nicolas Patry's avatar
      Enable TruncationStrategy override for pipelines (#9432) · d20e9c72
      Nicolas Patry authored
      * Enable TruncationStrategy override for pipelines
      
      * Update isort.
      
      * Fixing test
      
      * Fixing text_generation pipeline.
      
      * Using same DummyTok as other PR  for easier merge later.
      
      * Some more import guards.
      
      * Remove bogus file.
      
      * Do not pass `generate_kwargs` to `_parse_and_tokenize`.
      @patrickvonplaten
      
      * Removed DummyTok.
      
      * Doc quality.
      d20e9c72
    • Patrick von Platen's avatar
      fix tf led pt test (#9513) · 6c8ec2a9
      Patrick von Platen authored
      6c8ec2a9
    • Lysandre Debut's avatar
      Remove tolerance + drop_rows_to_fit by default (#9507) · d415882b
      Lysandre Debut authored
      * Remove tolerance + drop_rows_to_fit by default
      
      * remove drop_rows_to_fit
      d415882b
    • Julien Plu's avatar
      Full rework of the TF input/output embeddings and bias resizing (#9193) · 1243ee7d
      Julien Plu authored
      * Start rework resizing
      
      * Rework bias/decoder resizing
      
      * Full resizing rework
      
      * Full resizing rework
      
      * Start to update the models with the new approach
      
      * Finish to update the models
      
      * Update all the tests
      
      * Update the template
      
      * Fix tests
      
      * Fix tests
      
      * Test a new approach
      
      * Refactoring
      
      * Refactoring
      
      * Refactoring
      
      * New rework
      
      * Rework BART
      
      * Rework bert+blenderbot
      
      * Rework CTRL
      
      * Rework Distilbert
      
      * Rework DPR
      
      * Rework Electra
      
      * Rework Flaubert
      
      * Rework Funnel
      
      * Rework GPT2
      
      * Rework Longformer
      
      * Rework Lxmert
      
      * Rework marian+mbart
      
      * Rework mobilebert
      
      * Rework mpnet
      
      * Rework openai
      
      * Rework pegasus
      
      * Rework Roberta
      
      * Rework T5
      
      * Rework xlm+xlnet
      
      * Rework template
      
      * Fix TFT5EncoderOnly + DPRs
      
      * Restore previous methods
      
      * Fix Funnel
      
      * Fix CTRL and TransforXL
      
      * Apply style
      
      * Apply Sylvain's comments
      
      * Restore a test in DPR
      
      * Address the comments
      
      * Fix bug
      
      * Apply style
      
      * remove unused import
      
      * Fix test
      
      * Forgot a method
      
      * missing test
      
      * Trigger CI
      
      * naming update
      
      * Rebase
      
      * Trigger CI
      1243ee7d
  2. 10 Jan, 2021 1 commit
  3. 08 Jan, 2021 2 commits
  4. 07 Jan, 2021 3 commits
    • Patrick von Platen's avatar
      [TFGPT2] - Fix flaky past_key_values test (#9460) · f33a6f34
      Patrick von Platen authored
      * fix tf flakey
      
      * remove test files
      f33a6f34
    • Patrick von Platen's avatar
      [LED Test] fix common inputs pt for flaky pt-tf led test (#9459) · a400fe89
      Patrick von Platen authored
      * fix common inputs pt flakey led
      
      * fix other tests correspondingly
      a400fe89
    • Julien Plu's avatar
      New serving (#9419) · 812045ad
      Julien Plu authored
      * Add a serving method
      
      * Add albert
      
      * Add serving for BERT and BART
      
      * Add more models
      
      * Finish the serving addition
      
      * Temp fix
      
      * Restore DPR
      
      * Fix funnel attribute
      
      * Fix attributes GPT2
      
      * Fix OpenAIGPT attribute
      
      * Fix T5 attributes
      
      * Fix Bart attributes
      
      * Fix TransfoXL attributes
      
      * Add versioning
      
      * better test
      
      * Update template
      
      * Fix Flaubert
      
      * Fix T5
      
      * Apply style
      
      * Remove unused imports
      
      * Deactivate extra parameters
      
      * Remove too long test + saved_model default to False
      
      * Ignore the saved model test for some models
      
      * Fix some inputs
      
      * Fix mpnet serving
      
      * Trigger CI
      
      * Address all comments
      812045ad
  5. 06 Jan, 2021 4 commits
    • Patrick von Platen's avatar
      [GenerationOutputs] Fix GenerationOutputs Tests (#9443) · b8462b5b
      Patrick von Platen authored
      * fix generation models
      
      * fix led
      
      * fix docs
      
      * add is_decoder
      
      * fix last docstrings
      
      * make style
      
      * fix t5 cross attentions
      
      * correct t5
      b8462b5b
    • Sylvain Gugger's avatar
      Fast transformers import part 1 (#9441) · 0c96262f
      Sylvain Gugger authored
      * Don't import libs to check they are available
      
      * Don't import integrations at init
      
      * Add importlib_metdata to deps
      
      * Remove old vars references
      
      * Avoid syntax error
      
      * Adapt testing utils
      
      * Try to appease torchhub
      
      * Add dependency
      
      * Remove more private variables
      
      * Fix typo
      
      * Another typo
      
      * Refine the tf availability test
      0c96262f
    • Simon Brandeis's avatar
      Add flags to return scores, hidden states and / or attention weights in GenerationMixin (#9150) · c89f1bc9
      Simon Brandeis authored
      
      
      * Define new output dataclasses for greedy generation
      
      * Add output_[...] flags in greedy generation methods
      
      Added output_attentions, output_hidden_states, output_scores flags in
      generate and greedy_search methods in GenerationMixin.
      
      * [WIP] Implement logic and tests for output flags in generation
      
      * Update GreedySearchOutput classes & docstring
      
      * Implement greedy search output accumulation logic
      
      Update greedy_search unittests
      
      Fix generate method return value docstring
      
      Properly init flags with the default config
      
      * Update configuration to add output_scores flag
      
      * Fix test_generation_utils
      
      Sort imports and fix isinstance tests for GreedySearchOutputs
      
      * Fix typo in generation_utils
      
      * Add return_dict_in_generate for backwards compatibility
      
      * Add return_dict_in_generate flag in config
      
      * Fix tyPo in configuration
      
      * Fix handling of attentions and hidden_states flags
      
      * Make style & quality
      
      * first attempt attentions
      
      * some corrections
      
      * improve tests
      
      * special models requires special test
      
      * disable xlm test for now
      
      * clean tests
      
      * fix for tf
      
      * isort
      
      * Add output dataclasses for other generation methods
      
      * Add logic to return dict in sample generation
      
      * Complete test for sample generation
      
      - Pass output_attentions and output_hidden_states flags to encoder in
      encoder-decoder models
      - Fix import satements order in test_generation_utils file
      
      * Add logic to return dict in sample generation
      
      - Refactor tests to avoid using self.assertTrue, which provides
      scarce information when the test fails
      - Add tests for the three beam_search methods: vanilla, sample and
      grouped
      
      * Style doc
      
      * Fix copy-paste error in generation tests
      
      * Rename logits to scores and refactor
      
      * Refactor group_beam_search for consistency
      
      * make style
      
      * add sequences_scores
      
      * fix all tests
      
      * add docs
      
      * fix beam search finalize test
      
      * correct docstring
      
      * clean some files
      
      * Made suggested changes to the documentation
      
      * Style doc ?
      
      * Style doc using the Python util
      
      * Update src/transformers/generation_utils.py
      
      * fix empty lines
      
      * fix all test
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      c89f1bc9
    • Stas Bekman's avatar
      [trainer] self.model_wrapped + _model_unwrap (#9390) · 9f675b05
      Stas Bekman authored
      
      
      * model wrapped + model_unwrap
      
      * cleanup
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * style
      
      * deprecation warning
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      9f675b05
  6. 05 Jan, 2021 3 commits
    • Patrick von Platen's avatar
      [PyTorch Bart] Split Bart into different models (#9343) · eef66035
      Patrick von Platen authored
      * first try
      
      * remove old template
      
      * finish bart
      
      * finish mbart
      
      * delete unnecessary line
      
      * init pegasus
      
      * save intermediate
      
      * correct pegasus
      
      * finish pegasus
      
      * remove cookie cutter leftover
      
      * add marian
      
      * finish blenderbot
      
      * replace in file
      
      * correctly split blenderbot
      
      * delete "old" folder
      
      * correct "add statement"
      
      * adapt config for tf comp
      
      * correct configs for tf
      
      * remove ipdb
      
      * fix more stuff
      
      * fix mbart
      
      * push pegasus fix
      
      * fix mbart
      
      * more fixes
      
      * fix research projects code
      
      * finish docs for bart, mbart, and marian
      
      * delete unnecessary file
      
      * correct attn typo
      
      * correct configs
      
      * remove pegasus for seq class
      
      * correct peg docs
      
      * correct peg docs
      
      * finish configs
      
      * further improve docs
      
      * add copied from statements to mbart
      
      * fix copied from in mbart
      
      * add copy statements to marian
      
      * add copied from to marian
      
      * add pegasus copied from
      
      * finish pegasus
      
      * finish copied from
      
      * Apply suggestions from code review
      
      * make style
      
      * backward comp blenderbot
      
      * apply lysandres and sylvains suggestions
      
      * apply suggestions
      
      * push last fixes
      
      * fix docs
      
      * fix tok tests
      
      * fix imports code style
      
      * fix doc
      eef66035
    • Patrick von Platen's avatar
      LED (#9278) · 189387e9
      Patrick von Platen authored
      * create model
      
      * add integration
      
      * save current state
      
      * make integration tests pass
      
      * add one more test
      
      * add explanation to tests
      
      * remove from bart
      
      * add padding
      
      * remove unnecessary test
      
      * make all tests pass
      
      * re-add cookie cutter tests
      
      * finish PyTorch
      
      * fix attention test
      
      * Update tests/test_modeling_common.py
      
      * revert change
      
      * remove unused file
      
      * add string to doc
      
      * save intermediate
      
      * make tf integration tests pass
      
      * finish tf
      
      * fix doc
      
      * fix docs again
      
      * add led to doctree
      
      * add to auto tokenizer
      
      * added tips for led
      
      * make style
      
      * apply jplus statements
      
      * correct tf longformer
      
      * apply lysandres suggestions
      
      * apply sylvains suggestions
      
      * Apply suggestions from code review
      189387e9
    • Julien Plu's avatar
      Use stable functions (#9369) · 4225740a
      Julien Plu authored
      4225740a
  7. 04 Jan, 2021 1 commit
  8. 25 Dec, 2020 1 commit
  9. 24 Dec, 2020 1 commit
    • Ratthachat (Jung)'s avatar
      Proposed Fix : [RagSequenceForGeneration] generate "without" input_ids (#9220) · f3a3b91d
      Ratthachat (Jung) authored
      * Create modeling_tf_dpr.py
      
      * Add TFDPR
      
      * Add back TFPegasus, TFMarian, TFMBart, TFBlenderBot
      
      last commit accidentally deleted these 4 lines, so I recover them back
      
      * Add TFDPR
      
      * Add TFDPR
      
      * clean up some comments, add TF input-style doc string
      
      * Add TFDPR
      
      * Make return_dict=False as default
      
      * Fix return_dict bug (in .from_pretrained)
      
      * Add get_input_embeddings()
      
      * Create test_modeling_tf_dpr.py
      
      The current version is already passed all 27 tests!
      Please see the test run at : 
      https://colab.research.google.com/drive/1czS_m9zy5k-iSJbzA_DP1k1xAAC_sdkf?usp=sharing
      
      
      
      * fix quality
      
      * delete init weights
      
      * run fix copies
      
      * fix repo consis
      
      * del config_class, load_tf_weights
      
      They shoud be 'pytorch only'
      
      * add config_class back
      
      after removing it, test failed ... so totally only removing "use_tf_weights = None" on Lysandre suggestion
      
      * newline after .. note::
      
      * import tf, np (Necessary for ModelIntegrationTest)
      
      * slow_test from_pretrained with from_pt=True
      
      At the moment we don't have TF weights (since we don't have official official TF model)
      Previously, I did not run slow test, so I missed this bug
      
      * Add simple TFDPRModelIntegrationTest
      
      Note that this is just a test that TF and Pytorch gives approx. the same output.
      However, I could not test with the official DPR repo's output yet
      
      * upload correct tf model
      
      * remove position_ids as missing keys
      
      * fix RagSeq generate with context_input_ids
      
      fix RagSeq generate with context_input_ids
      
      * apply style
      
      * delete unused lines
      
      * Add test_rag_sequence_generate_batch_from_context_input_ids
      
      * Readability improved
      
      * stylying
      
      * Stylize
      
      * typos
      
      * add check_model_generate_from_context_input_ids
      
      * make style
      
      * Apply suggestions from code review
      
      * make style2
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarpatrickvonplaten <patrick@huggingface.co>
      f3a3b91d
  10. 23 Dec, 2020 1 commit
    • Suraj Patil's avatar
      Add caching mechanism to BERT, RoBERTa (#9183) · 88ef8893
      Suraj Patil authored
      * add past_key_values
      
      * add use_cache option
      
      * make mask before cutting ids
      
      * adjust position_ids according to past_key_values
      
      * flatten past_key_values
      
      * fix positional embeds
      
      * fix _reorder_cache
      
      * set use_cache to false when not decoder, fix attention mask init
      
      * add test for caching
      
      * add past_key_values for Roberta
      
      * fix position embeds
      
      * add caching test for roberta
      
      * add doc
      
      * make style
      
      * doc, fix attention mask, test
      
      * small fixes
      
      * adress patrick's comments
      
      * input_ids shouldn't start with pad token
      
      * use_cache only when decoder
      
      * make consistent with bert
      
      * make copies consistent
      
      * add use_cache to encoder
      
      * add past_key_values to tapas attention
      
      * apply suggestions from code review
      
      * make coppies consistent
      
      * add attn mask in tests
      
      * remove copied from longformer
      
      * apply suggestions from code review
      
      * fix bart test
      
      * nit
      
      * simplify model outputs
      
      * fix doc
      
      * fix output ordering
      88ef8893
  11. 22 Dec, 2020 3 commits
  12. 21 Dec, 2020 3 commits
  13. 19 Dec, 2020 1 commit
    • sandip's avatar
      Added TF TransfoXL Sequence Classification (#9169) · e0e255be
      sandip authored
      * TF Transfoxl seq classification
      
      * Update test_modeling_tf_transfo_xl.py
      
      Added num_labels to config level
      
      * TF Transfoxl seq classification
      
      * Update test_modeling_tf_transfo_xl.py
      
      Added num_labels to config level
      
      * code refactor
      
      * code refactor
      
      * code refator
      e0e255be
  14. 18 Dec, 2020 2 commits
  15. 17 Dec, 2020 1 commit
  16. 16 Dec, 2020 3 commits
    • Lysandre Debut's avatar
      TableQuestionAnsweringPipeline (#9145) · 1c1a2ffb
      Lysandre Debut authored
      
      
      * AutoModelForTableQuestionAnswering
      
      * TableQuestionAnsweringPipeline
      
      * Apply suggestions from Patrick's code review
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Sylvain and Patrick comments
      
      * Better PyTorch/TF error message
      
      * Add integration tests
      
      * Argument Handler naming
      Co-authored-by: default avatarpatrickvonplaten <patrick.v.platen@gmail.com>
      
      * Fix docs to appease the documentation gods
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      1c1a2ffb
    • Lysandre Debut's avatar
      AutoModelForTableQuestionAnswering (#9154) · 07384baf
      Lysandre Debut authored
      * AutoModelForTableQuestionAnswering
      
      * Update src/transformers/models/auto/modeling_auto.py
      
      * Style
      07384baf
    • Patrick von Platen's avatar
      [Flax] Align FlaxBertForMaskedLM with BertForMaskedLM, implement from_pretrained, init (#9054) · 640e6fe1
      Patrick von Platen authored
      
      
      * save intermediate
      
      * save intermediate
      
      * save intermediate
      
      * correct flax bert model file
      
      * new module / model naming
      
      * make style
      
      * almost finish BERT
      
      * finish roberta
      
      * make fix-copies
      
      * delete keys file
      
      * last refactor
      
      * fixes in run_mlm_flax.py
      
      * remove pooled from run_mlm_flax.py`
      
      * fix gelu | gelu_new
      
      * remove Module from inits
      
      * splits
      
      * dirty print
      
      * preventing warmup_steps == 0
      
      * smaller splits
      
      * make fix-copies
      
      * dirty print
      
      * dirty print
      
      * initial_evaluation argument
      
      * declaration order fix
      
      * proper model initialization/loading
      
      * proper initialization
      
      * run_mlm_flax improvements: improper model inputs bugfix + automatic dataset splitting + tokenizers parallelism warning + avoiding warmup_steps=0 bug
      
      * removed tokenizers warning hack, fixed model re-initialization
      
      * reverted training_args.py changes
      
      * fix flax from pretrained
      
      * improve test in flax
      
      * apply sylvains tips
      
      * update init
      
      * make 0.3.0 compatible
      
      * revert tevens changes
      
      * revert tevens changes 2
      
      * finalize revert
      
      * fix bug
      
      * add docs
      
      * add pretrained to init
      
      * Update src/transformers/modeling_flax_utils.py
      
      * fix copies
      
      * final improvements
      Co-authored-by: default avatarTevenLeScao <teven.lescao@gmail.com>
      640e6fe1
  17. 15 Dec, 2020 6 commits
    • NielsRogge's avatar
      [WIP] Tapas v4 (tres) (#9117) · 1551e2dc
      NielsRogge authored
      
      
      * First commit: adding all files from tapas_v3
      
      * Fix multiple bugs including soft dependency and new structure of the library
      
      * Improve testing by adding torch_device to inputs and adding dependency on scatter
      
      * Use Python 3 inheritance rather than Python 2
      
      * First draft model cards of base sized models
      
      * Remove model cards as they are already on the hub
      
      * Fix multiple bugs with integration tests
      
      * All model integration tests pass
      
      * Remove print statement
      
      * Add test for convert_logits_to_predictions method of TapasTokenizer
      
      * Incorporate suggestions by Google authors
      
      * Fix remaining tests
      
      * Change position embeddings sizes to 512 instead of 1024
      
      * Comment out positional embedding sizes
      
      * Update PRETRAINED_VOCAB_FILES_MAP and PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      
      * Added more model names
      
      * Fix truncation when no max length is specified
      
      * Disable torchscript test
      
      * Make style & make quality
      
      * Quality
      
      * Address CI needs
      
      * Test the Masked LM model
      
      * Fix the masked LM model
      
      * Truncate when overflowing
      
      * More much needed docs improvements
      
      * Fix some URLs
      
      * Some more docs improvements
      
      * Test PyTorch scatter
      
      * Set to slow + minify
      
      * Calm flake8 down
      
      * First commit: adding all files from tapas_v3
      
      * Fix multiple bugs including soft dependency and new structure of the library
      
      * Improve testing by adding torch_device to inputs and adding dependency on scatter
      
      * Use Python 3 inheritance rather than Python 2
      
      * First draft model cards of base sized models
      
      * Remove model cards as they are already on the hub
      
      * Fix multiple bugs with integration tests
      
      * All model integration tests pass
      
      * Remove print statement
      
      * Add test for convert_logits_to_predictions method of TapasTokenizer
      
      * Incorporate suggestions by Google authors
      
      * Fix remaining tests
      
      * Change position embeddings sizes to 512 instead of 1024
      
      * Comment out positional embedding sizes
      
      * Update PRETRAINED_VOCAB_FILES_MAP and PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      
      * Added more model names
      
      * Fix truncation when no max length is specified
      
      * Disable torchscript test
      
      * Make style & make quality
      
      * Quality
      
      * Address CI needs
      
      * Test the Masked LM model
      
      * Fix the masked LM model
      
      * Truncate when overflowing
      
      * More much needed docs improvements
      
      * Fix some URLs
      
      * Some more docs improvements
      
      * Add add_pooling_layer argument to TapasModel
      
      Fix comments by @sgugger and @patrickvonplaten
      
      * Fix issue in docs + fix style and quality
      
      * Clean up conversion script and add task parameter to TapasConfig
      
      * Revert the task parameter of TapasConfig
      
      Some minor fixes
      
      * Improve conversion script and add test for absolute position embeddings
      
      * Improve conversion script and add test for absolute position embeddings
      
      * Fix bug with reset_position_index_per_cell arg of the conversion cli
      
      * Add notebooks to the examples directory and fix style and quality
      
      * Apply suggestions from code review
      
      * Move from `nielsr/` to `google/` namespace
      
      * Apply Sylvain's comments
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      Co-authored-by: default avatarRogge Niels <niels.rogge@howest.be>
      Co-authored-by: default avatarLysandreJik <lysandre.debut@reseau.eseo.fr>
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      1551e2dc
    • Sylvain Gugger's avatar
      Add possibility to switch between APEX and AMP in Trainer (#9137) · ad895af9
      Sylvain Gugger authored
      
      
      * Add possibility to switch between APEX and AMP in Trainer
      
      * Update src/transformers/training_args.py
      Co-authored-by: default avatarStas Bekman <stas00@users.noreply.github.com>
      
      * Address review comments
      
      * Update src/transformers/training_args.py
      Co-authored-by: default avatarStas Bekman <stas00@users.noreply.github.com>
      Co-authored-by: default avatarStas Bekman <stas00@users.noreply.github.com>
      ad895af9
    • Lysandre Debut's avatar
      Add large model config (#9140) · 0b2f46fa
      Lysandre Debut authored
      0b2f46fa
    • Patrick von Platen's avatar
      [TF Bart] Refactor TFBart (#9029) · abc573f5
      Patrick von Platen authored
      * reorder file
      
      * delete unnecesarry function
      
      * make style
      
      * save intermediate
      
      * fix attention masks
      
      * correct tf bart past key values
      
      * solve merge conflict bug
      
      * correct tensor dims
      
      * save intermediate tf
      
      * change attn layer
      
      * fix typo re-order past
      
      * inputs_embeds
      
      * make fix copies
      
      * finish tests
      
      * fix graph mode
      
      * appyl lysandres suggestions
      abc573f5
    • sandip's avatar
      Added TF OpenAi GPT1 Sequence Classification (#9105) · 389aba34
      sandip authored
      
      
      * TF OpenAI GPT Sequence Classification
      
      * Update src/transformers/models/openai/modeling_tf_openai.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      389aba34
    • Julien Plu's avatar
      Fix tf2.4 (#9120) · ef2d4cd4
      Julien Plu authored
      
      
      * Fix tests for TF 2.4
      
      * Remove <2.4 limitation
      
      * Add version condition
      
      * Update tests/test_optimization_tf.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update tests/test_optimization_tf.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update tests/test_optimization_tf.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      ef2d4cd4