1. 17 Nov, 2021 1 commit
    • N's avatar
      [WIP] Ensure TF model configs can be converted to proper JSON (#14415) · 1991da07
      N authored
      
      
      * test: make sure model configs are jsonifiable
      
      * fix: return python dict instead of config object
      
      * fix: accept pretrained config and use correct class
      
      * Re-enabling slow tests and applying them to core models only
      
      * Re-enabling slow tests and applying them to core models only
      
      * Add new test file to fetcher
      
      * Remove tooslow tests from test_modeling_tf_common.py
      
      * make style
      
      * Style fixes
      
      * Style fixes
      
      * Style fixes
      
      * Style fixes
      
      * Adding core tests to GPT2 and BART
      
      * Removing unused imports
      Co-authored-by: default avatarniklas.fruehauf <niklas.fruehauf@sovanta.com>
      Co-authored-by: default avatarmatt <rocketknight1@gmail.com>
      1991da07
  2. 26 Apr, 2021 1 commit
    • Daniel Stancl's avatar
      TF BART models - Add `cross_attentions` to model output and fix... · 38a716cd
      Daniel Stancl authored
      TF BART models - Add `cross_attentions` to model output and fix cross-attention head masking (#10699)
      
      * Add cross_attn_head_mask to BART
      
      * Fix cross_attentions in TFBart-like models
      
      * This commit enables returning of `cross_attentions`
      for TFBart-like models
      
      * It also fixes attention head masking in cross-attenion module
      
      * Update TF model templates
      
      * Fix missing , in TF model templates
      
      * Fix typo: congig -> config
      38a716cd
  3. 31 Mar, 2021 1 commit
  4. 17 Feb, 2021 1 commit
    • Julien Plu's avatar
      Making TF BART-like models XLA and AMP compliant (#10191) · 83d803ba
      Julien Plu authored
      * Update BART
      
      * Update Blenderbot
      
      * Update BlenderbotSmall
      
      * Update Marian
      
      * Update MBart
      
      * Update MBart
      
      * Update Pegasus
      
      * Update template
      
      * Fix Marian and Pegasus
      
      * Apply style
      
      * Default initializer
      
      * Default initializer
      
      * Default initializer
      
      * Remove int32 casts
      
      * Fix template
      
      * Remove more cast
      83d803ba
  5. 15 Feb, 2021 1 commit
    • Julien Plu's avatar
      Check TF ops for ONNX compliance (#10025) · c8d3fa0d
      Julien Plu authored
      
      
      * Add check-ops script
      
      * Finish to implement check_tf_ops and start the test
      
      * Make the test mandatory only for BERT
      
      * Update tf_ops folder
      
      * Remove useless classes
      
      * Add the ONNX test for GPT2 and BART
      
      * Add a onnxruntime slow test + better opset flexibility
      
      * Fix test + apply style
      
      * fix tests
      
      * Switch min opset from 12 to 10
      
      * Update src/transformers/file_utils.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Fix GPT2
      
      * Remove extra shape_list usage
      
      * Fix GPT2
      
      * Address Morgan's comments
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      c8d3fa0d
  6. 29 Jan, 2021 1 commit
  7. 28 Jan, 2021 1 commit
    • Daniel Stancl's avatar
      Remove redundant `test_head_masking = True` flags in test files (#9858) · 4c3ae89a
      Daniel Stancl authored
      * Remove redundant test_head_masking = True flags
      
      * Remove all redundant test_head_masking flags in PyTorch test_modeling_* files
      
      * Make test_head_masking = True as a default choice in test_modeling_tf_commong.py
      
      * Remove all redundant test_head_masking flags in TensorFlow
      test_modeling_tf_* files
      
      * Put back test_head_masking=False fot TFT5 models
      4c3ae89a
  8. 27 Jan, 2021 1 commit
  9. 26 Jan, 2021 1 commit
    • Daniel Stancl's avatar
      Add head_mask/decoder_head_mask for TF BART models (#9639) · 1867d9a8
      Daniel Stancl authored
      * Add head_mask/decoder_head_mask for TF BART models
      
      * Add head_mask and decoder_head_mask input arguments for TF BART-based
      models as a TF counterpart to the PR #9569
      
      * Add test_headmasking functionality to tests/test_modeling_tf_common.py
      
      * TODO: Add a test to verify that we can get a gradient back for
      importance score computation
      
      * Remove redundant #TODO note
      
      Remove redundant #TODO note from tests/test_modeling_tf_common.py
      
      * Fix assertions
      
      * Make style
      
      * Fix ...Model input args and adjust one new test
      
      * Add back head_mask and decoder_head_mask to BART-based ...Model
      after the last commit
      
      * Remove head_mask ande decoder_head_mask from input_dict
      in TF test_train_pipeline_custom_model as these two have different
      shape than other input args (Necessary for passing this test)
      
      * Revert adding global_rng in test_modeling_tf_common.py
      1867d9a8
  10. 21 Jan, 2021 1 commit
    • Julien Plu's avatar
      Fix TF s2s models (#9478) · a7dabfb3
      Julien Plu authored
      * Fix Seq2Seq models for serving
      
      * Apply style
      
      * Fix lonfgormer
      
      * Fix mBart/Pegasus/Blenderbot
      
      * Apply style
      
      * Add a main intermediate layer
      
      * Apply style
      
      * Remove import
      
      * Apply tf.function to Longformer
      
      * Fix utils check_copy
      
      * Update S2S template
      
      * Fix BART + Blenderbot
      
      * Fix BlenderbotSmall
      
      * Fix BlenderbotSmall
      
      * Fix BlenderbotSmall
      
      * Fix MBart
      
      * Fix Marian
      
      * Fix Pegasus + template
      
      * Apply style
      
      * Fix common attributes test
      
      * Forgot to fix the LED test
      
      * Apply Patrick's comment on LED Decoder
      a7dabfb3
  11. 13 Jan, 2021 1 commit
    • Lysandre Debut's avatar
      Fix slow tests v4.2.0 (#9561) · c9495166
      Lysandre Debut authored
      * Fix conversational pipeline test
      
      * LayoutLM
      
      * ProphetNet
      
      * BART
      
      * Blenderbot & small
      
      * Marian
      
      * mBART
      
      * Pegasus
      
      * Tapas tokenizer
      
      * BERT2BERT test
      
      * Style
      
      * Example requirements
      
      * TF BERT2BERT test
      c9495166
  12. 12 Jan, 2021 1 commit
    • Patrick von Platen's avatar
      [TFBart] Split TF-Bart (#9497) · 7f286132
      Patrick von Platen authored
      * make templates ready
      
      * make add_new_model_command_ready
      
      * finish tf bart
      
      * prepare tf mbart
      
      * finish tf bart
      
      * add tf mbart
      
      * add marian
      
      * prep pegasus
      
      * add tf pegasus
      
      * push blenderbot tf
      
      * add blenderbot
      
      * add blenderbot small
      
      * clean-up
      
      * make fix copy
      
      * define blend bot tok
      
      * fix
      
      * up
      
      * make style
      
      * add to docs
      
      * add copy statements
      
      * overwrite changes
      
      * improve
      
      * fix docs
      
      * finish
      
      * fix last slow test
      
      * fix missing git conflict line
      
      * fix blenderbot
      
      * up
      
      * fix blenderbot small
      
      * load changes
      
      * finish copied from
      
      * upload fix
      7f286132
  13. 11 Jan, 2021 1 commit
    • 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
  14. 07 Jan, 2021 1 commit
    • 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
  15. 05 Jan, 2021 1 commit
    • 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
  16. 22 Dec, 2020 2 commits
    • Patrick von Platen's avatar
      Model Templates for Seq2Seq (#9251) · cbe63949
      Patrick von Platen authored
      * adapt cookie cutter
      
      * fix copy past statement
      
      * delete copy statements for now
      
      * remove unused import from template
      
      * make doc rst
      
      * correct config docstring
      
      * correct training
      
      * correct inputs processing tf enc dec
      
      * make style
      
      * adapt templates
      
      * clean tabs
      
      * correct tensor -> Tensor naming
      
      * correct indent
      
      * correct templates
      
      * fix the test
      
      * break lines to avoid > 119
      
      * Apply suggestions from code review
      cbe63949
    • Patrick von Platen's avatar
      [EncoderDecoder] Make tests more aggressive (#9256) · e9d77ccd
      Patrick von Platen authored
      * add tests
      
      * make style and fix bart bug
      
      * fix bart past key value edge case
      
      * correct tf bart test
      
      * fix gpt2 tf
      
      * fix t5 test
      e9d77ccd
  17. 15 Dec, 2020 1 commit
    • 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
  18. 14 Dec, 2020 2 commits
    • Julien Plu's avatar
      Fix T5 and BART for TF (#9063) · df3f4d2a
      Julien Plu authored
      * Fix T5 for graphe compilation+execution
      
      * Fix BART
      
      * Fix import
      
      * Fix naming
      
      * fix attribute name
      
      * Oops
      
      * fix import
      
      * fix tests
      
      * fix tests
      
      * Update test
      
      * Add mising import
      
      * Address Patrick's comments
      
      * Style
      
      * Address Patrick's comment
      df3f4d2a
    • Julien Plu's avatar
      Fix embeddings resizing in TF models (#8657) · 51d9c569
      Julien Plu authored
      * Resize the biases in same time than the embeddings
      
      * Trigger CI
      
      * Biases are not reset anymore
      
      * Remove get_output_embeddings + better LM model detection in generation utils
      
      * Apply style
      
      * First test on BERT
      
      * Update docstring + new name
      
      * Apply the new resizing logic to all the models
      
      * fix tests
      
      * Apply style
      
      * Update the template
      
      * Fix naming
      
      * Fix naming
      
      * Apply style
      
      * Apply style
      
      * Remove unused import
      
      * Revert get_output_embeddings
      
      * Trigger CI
      
      * Update num parameters
      
      * Restore get_output_embeddings in TFPretrainedModel and add comments
      
      * Style
      
      * Add decoder resizing
      
      * Style
      
      * Fix tests
      
      * Separate bias and decoder resize
      
      * Fix tests
      
      * Fix tests
      
      * Apply style
      
      * Add bias resizing in MPNet
      
      * Trigger CI
      
      * Apply style
      51d9c569
  19. 24 Nov, 2020 1 commit
    • Julien Plu's avatar
      New TF model inputs (#8602) · 29d49924
      Julien Plu authored
      * Apply on BERT and ALBERT
      
      * Update TF Bart
      
      * Add input processing to TF BART
      
      * Add input processing for TF CTRL
      
      * Add input processing to TF Distilbert
      
      * Add input processing to TF DPR
      
      * Add input processing to TF Electra
      
      * Add input processing for TF Flaubert
      
      * Add deprecated arguments
      
      * Add input processing to TF XLM
      
      * remove unused imports
      
      * Add input processing to TF Funnel
      
      * Add input processing to TF GPT2
      
      * Add input processing to TF Longformer
      
      * Add input processing to TF Lxmert
      
      * Apply style
      
      * Add input processing to TF Mobilebert
      
      * Add input processing to TF GPT
      
      * Add input processing to TF Roberta
      
      * Add input processing to TF T5
      
      * Add input processing to TF TransfoXL
      
      * Apply style
      
      * Rebase on master
      
      * Bug fix
      
      * Retry to bugfix
      
      * Retry bug fix
      
      * Fix wrong model name
      
      * Try another fix
      
      * Fix BART
      
      * Fix input precessing
      
      * Apply style
      
      * Put the deprecated warnings in the input processing function
      
      * Remove the unused imports
      
      * Raise an error when len(kwargs)>0
      
      * test ModelOutput instead of TFBaseModelOutput
      
      * Bug fix
      
      * Address Patrick's comments
      
      * Address Patrick's comments
      
      * Address Sylvain's comments
      
      * Add the new inputs in new Longformer models
      
      * Update the template with the new input processing
      
      * Remove useless assert
      
      * Apply style
      
      * Trigger CI
      29d49924
  20. 17 Nov, 2020 1 commit
    • Sylvain Gugger's avatar
      Reorganize repo (#8580) · c89bdfbe
      Sylvain Gugger authored
      * Put models in subfolders
      
      * Styling
      
      * Fix imports in tests
      
      * More fixes in test imports
      
      * Sneaky hidden imports
      
      * Fix imports in doc files
      
      * More sneaky imports
      
      * Finish fixing tests
      
      * Fix examples
      
      * Fix path for copies
      
      * More fixes for examples
      
      * Fix dummy files
      
      * More fixes for example
      
      * More model import fixes
      
      * Is this why you're unhappy GitHub?
      
      * Fix imports in conver command
      c89bdfbe
  21. 16 Nov, 2020 1 commit
    • Sylvain Gugger's avatar
      Switch `return_dict` to `True` by default. (#8530) · 1073a2bd
      Sylvain Gugger authored
      * Use the CI to identify failing tests
      
      * Remove from all examples and tests
      
      * More default switch
      
      * Fixes
      
      * More test fixes
      
      * More fixes
      
      * Last fixes hopefully
      
      * Use the CI to identify failing tests
      
      * Remove from all examples and tests
      
      * More default switch
      
      * Fixes
      
      * More test fixes
      
      * More fixes
      
      * Last fixes hopefully
      
      * Run on the real suite
      
      * Fix slow tests
      1073a2bd
  22. 30 Oct, 2020 1 commit
    • Sam Shleifer's avatar
      TFMarian, TFMbart, TFPegasus, TFBlenderbot (#7987) · 566b083e
      Sam Shleifer authored
      
      
      * Start plumbing
      
      * Marian close
      
      * Small stubs for all children
      
      * Fixed bart
      
      * marian working
      
      * pegasus test is good, but failing
      
      * Checkin tests
      
      * More model files
      
      * Subtle marian, pegasus integration test failures
      
      * Works well
      
      * rm print
      
      * boom boom
      
      * Still failing model2doc
      
      * merge master
      
      * Equivalence test failing, all others fixed
      
      * cleanup
      
      * Fix embed_scale
      
      * Cleanup marian pipeline test
      
      * Undo extra changes
      
      * Smaller delta
      
      * Cleanup model testers
      
      * undo delta
      
      * fix tests import structure
      
      * cross test decorator
      
      * Cleaner set_weights
      
      * Respect authorized_unexpected_keys
      
      * No warnings
      
      * No warnings
      
      * style
      
      * Nest tf import
      
      * black
      
      * Apply suggestions from code review
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * functional dropout
      
      * fixup
      
      * Fixup
      
      * style_doc
      
      * embs
      
      * shape list
      
      * delete slow force_token_id_to_be_generated func
      
      * fixup
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      566b083e
  23. 23 Oct, 2020 1 commit
  24. 21 Oct, 2020 1 commit
    • Sam Shleifer's avatar
      Add TFBartForConditionalGeneration (#5411) · 82984215
      Sam Shleifer authored
      
      
      * half done
      
      * doc improvement
      
      * Cp test file
      
      * brokedn
      
      * broken test
      
      * undo some mess
      
      * ckpt
      
      * borked
      
      * Halfway
      
      * 6 passing
      
      * boom boom
      
      * Much progress but still 6
      
      * boom boom
      
      * merged master
      
      * 10 passing
      
      * boom boom
      
      * Style
      
      * no t5 changes
      
      * 13 passing
      
      * Integration test failing, but not gibberish
      
      * Frustrated
      
      * Merged master
      
      * 4 fail
      
      * 4 fail
      
      * fix return_dict
      
      * boom boom
      
      * Still only 4
      
      * prepare method
      
      * prepare method
      
      * before delete classif
      
      * Skip tests to avoid adding boilerplate
      
      * boom boom
      
      * fast tests passing
      
      * style
      
      * boom boom
      
      * Switch to supporting many input types
      
      * remove FIXMENORM
      
      * working
      
      * Fixed past_key_values/decoder_cached_states confusion
      
      * new broken test
      
      * Fix attention mask kwarg name
      
      * undo accidental
      
      * Style and reviewers
      
      * style
      
      * Docs and common tests
      
      * Cleaner assert messages
      
      * copy docs
      
      * style issues
      
      * Sphinx fix
      
      * Simplify caching logic
      
      * test does not require torch
      
      * copy _NoLayerEmbedTokens
      
      * Update src/transformers/modeling_tf_bart.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Update tests/test_modeling_tf_bart.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Update src/transformers/modeling_tf_bart.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Update src/transformers/modeling_tf_bart.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Update src/transformers/modeling_tf_bart.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Line length and dont document None
      
      * Add pipeline test coverage
      
      * assert msg
      
      * At parity
      
      * Assert messages
      
      * mark slow
      
      * Update compile test
      
      * back in init
      
      * Merge master
      
      * Fix tests
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      82984215