1. 16 Feb, 2024 1 commit
  2. 08 Aug, 2023 1 commit
    • JB (Don)'s avatar
      Add warning for missing attention mask when pad tokens are detected (#25345) · 5ea2595e
      JB (Don) authored
      * Add attention mask and pad token warning to many of the models
      
      * Remove changes under examples/research_projects
      
      These files are not maintained by HG.
      
      * Skip the warning check during torch.fx or JIT tracing
      
      * Switch ordering for the warning and input shape assignment
      
      This ordering is a little cleaner for some of the cases.
      
      * Add missing line break in one of the files
      5ea2595e
  3. 17 Jul, 2023 1 commit
    • Syed Salman Habeeb Quadri's avatar
      Replace assert statements with exceptions (#24856) · d0154015
      Syed Salman Habeeb Quadri authored
      * Changed AssertionError to ValueError
      
      try-except block was using AssesrtionError in except statement while the expected error is value error. Fixed the same.
      
      * Changed AssertionError to ValueError
      
      try-except block was using AssesrtionError in except statement while the expected error is ValueError. Fixed the same.
      Note: While raising the ValueError args are passed to it, but later added again while handling the error (See the code snippet)
      
      * Changed AssertionError to ValueError
      
      try-except block was using AssesrtionError in except statement while the expected error is ValueError. Fixed the same.
      Note: While raising the ValueError args are passed to it, but later added again while handling the error (See the code snippet)
      
      * Changed AssertionError to ValueError
      
      * Changed AssertionError to ValueError
      
      * Changed AssertionError to ValueError
      
      * Changed AssertionError to ValueError
      
      * Changed AssertionError to ValueError
      
      * Changed assert statement to ValueError based
      
      * Changed assert statement to ValueError based
      
      * Changed assert statement to ValueError based
      
      * Changed incorrect error handling from AssertionError to ValueError
      
      * Undoed change from AssertionError to ValueError as it is not needed
      
      * Reverted back to using AssertionError as it is not necessary to make it into ValueError
      
      * Fixed erraneous comparision
      
      Changed == to !=
      
      * Fixed erraneous comparision
      
      Changed == to !=
      
      * formatted the code
      
      * Ran make fix-copies
      d0154015
  4. 27 Jun, 2023 1 commit
    • Sylvain Gugger's avatar
      Clean load keys (#24505) · 8e5d1619
      Sylvain Gugger authored
      * Preliminary work on some models
      
      * Fix test load missing and make sure nonpersistent buffers are tested
      
      * Always ignore nonpersistent buffers if in state_dict
      
      * Treat models
      
      * More models
      
      * Treat remaining models
      
      * Fix quality
      
      * Fix tests
      
      * Remove draft
      
      * This test is not needed anymore
      
      * Fix copies
      
      * Fix last test
      
      * Newly added models
      
      * Fix last tests
      
      * Address review comments
      8e5d1619
  5. 26 Jun, 2023 1 commit
  6. 22 Jun, 2023 1 commit
  7. 21 Jun, 2023 1 commit
  8. 13 Jun, 2023 1 commit
    • Sylvain Gugger's avatar
      Tied params cleanup (#24211) · 695928e1
      Sylvain Gugger authored
      * First test
      
      * Add info for all models
      
      * style
      
      * Repo consistency
      
      * Fix last model and cleanup prints
      
      * Repo consistency
      
      * Use consistent function for detecting tied weights
      695928e1
  9. 06 Feb, 2023 1 commit
    • Sylvain Gugger's avatar
      Update quality tooling for formatting (#21480) · 6f79d264
      Sylvain Gugger authored
      * Result of black 23.1
      
      * Update target to Python 3.7
      
      * Switch flake8 to ruff
      
      * Configure isort
      
      * Configure isort
      
      * Apply isort with line limit
      
      * Put the right black version
      
      * adapt black in check copies
      
      * Fix copies
      6f79d264
  10. 23 Jan, 2023 1 commit
  11. 09 Nov, 2022 1 commit
    • Nicolas Patry's avatar
      Attempting to test automatically the `_keys_to_ignore`. (#20042) · bac2d29a
      Nicolas Patry authored
      
      
      * Attempting to test automatically the `_keys_to_ignore`.
      
      * Style.
      
      * First fix pass.
      
      * Moving test on its own.
      
      * Another batch.
      
      * Second round removing BatchNorm
      
      * Fixing layoutlmv{2,3} + support older Python.
      
      * Disable miss missing warning.
      
      * Removing dodgy additions.
      
      * Big pass.
      
      * mbart.
      
      * More corrections.
      
      * Fixup.
      
      * Updating test_correct_missing_keys
      
      * Add escape hatch for when the head has no extra params so doesn't need
      
      the missing keys check.
      
      * Fixing test.
      
      * Greener.
      
      * Green ! (except for weird splinter bug).
      
      * Adding a test about `named_parameters` usage.
      
      * Shorten message.
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * After rebase modifications.
      
      * More explicit condition checking.
      
      * Fixing slow tests issues.
      
      * Remove extra pdb.
      
      * Remove print.
      
      * Attempt to make failure consistent + fixing roc_bert.
      
      * Removing the seed  (all tests passing with it).
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      bac2d29a
  12. 14 Sep, 2022 1 commit
  13. 03 Aug, 2022 1 commit
    • LSinev's avatar
      Fix torch version comparisons (#18460) · 02b176c4
      LSinev authored
      Comparisons like
      version.parse(torch.__version__) > version.parse("1.6")
      are True for torch==1.6.0+cu101 or torch==1.6.0+cpu
      
      version.parse(version.parse(torch.__version__).base_version) are preferred (and available in pytorch_utils.py
      02b176c4
  14. 20 Jun, 2022 1 commit
  15. 12 May, 2022 1 commit
  16. 04 May, 2022 1 commit
  17. 22 Apr, 2022 1 commit
  18. 12 Apr, 2022 1 commit
    • Anmol Joshi's avatar
      Moved functions to pytorch_utils.py (#16625) · a315988b
      Anmol Joshi authored
      * Moved functions to pytorch_utils.py
      
      * isort formatting
      
      * Reverted tf changes
      
      * isort, make fix-copies
      
      * documentation fix
      
      * Fixed Conv1D import
      
      * Reverted research examples file
      
      * backward compatibility for pytorch_utils
      
      * missing import
      
      * isort fix
      a315988b
  19. 25 Mar, 2022 1 commit
  20. 23 Mar, 2022 1 commit
    • Sylvain Gugger's avatar
      Reorganize file utils (#16264) · 4975002d
      Sylvain Gugger authored
      * Split file_utils in several submodules
      
      * Fixes
      
      * Add back more objects
      
      * More fixes
      
      * Who exactly decided to import that from there?
      
      * Second suggestion to code with code review
      
      * Revert wront move
      
      * Fix imports
      
      * Adapt all imports
      
      * Adapt all imports everywhere
      
      * Revert this import, will fix in a separate commit
      4975002d
  21. 07 Feb, 2022 1 commit
    • Michael Benayoun's avatar
      FX tracing improvement (#14321) · 0fe17f37
      Michael Benayoun authored
      * Change the way tracing happens, enabling dynamic axes out of the box
      
      * Update the tests and modeling xlnet
      
      * Add the non recoding of leaf modules to avoid recording more values for the methods to record than what will be seen at tracing time (which would otherwise desynchronize the recorded values and the values that need to be given to the proxies during tracing, causing errors).
      
      * Comments and making tracing work for gpt-j and xlnet
      
      * Refactore things related to num_choices (and batch_size, sequence_length)
      
      * Update fx to work on PyTorch 1.10
      
      * Postpone autowrap_function feature usage for later
      
      * Add copyrights
      
      * Remove unnecessary file
      
      * Fix issue with add_new_model_like
      
      * Apply suggestions
      0fe17f37
  22. 31 Jan, 2022 1 commit
  23. 28 Jan, 2022 1 commit
  24. 28 Dec, 2021 1 commit
    • Sylvain Gugger's avatar
      Doc styler examples (#14953) · b5e2b183
      Sylvain Gugger authored
      * Fix bad examples
      
      * Add black formatting to style_doc
      
      * Use first nonempty line
      
      * Put it at the right place
      
      * Don't add spaces to empty lines
      
      * Better templates
      
      * Deal with triple quotes in docstrings
      
      * Result of style_doc
      
      * Enable mdx treatment and fix code examples in MDXs
      
      * Result of doc styler on doc source files
      
      * Last fixes
      
      * Break copy from
      b5e2b183
  25. 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
  26. 21 Dec, 2021 1 commit
    • Sylvain Gugger's avatar
      Convert docstrings of modeling files (#14850) · 7af80f66
      Sylvain Gugger authored
      * Convert file_utils docstrings to Markdown
      
      * Test on BERT
      
      * Return block indent
      
      * Temporarily disable doc styler
      
      * Remove from quality checks as well
      
      * Remove doc styler mess
      
      * Remove check from circleCI
      
      * Fix typo
      
      * Convert file_utils docstrings to Markdown
      
      * Test on BERT
      
      * Return block indent
      
      * Temporarily disable doc styler
      
      * Remove from quality checks as well
      
      * Remove doc styler mess
      
      * Remove check from circleCI
      
      * Fix typo
      
      * Let's go on all other model files
      
      * Add templates too
      
      * Styling and quality
      7af80f66
  27. 30 Nov, 2021 1 commit
  28. 18 Nov, 2021 2 commits
  29. 15 Oct, 2021 1 commit
  30. 11 Oct, 2021 1 commit
  31. 17 Sep, 2021 1 commit
    • Ibraheem Moosa's avatar
      Optimize Token Classification models for TPU (#13096) · eae7a96b
      Ibraheem Moosa authored
      * Optimize Token Classification models for TPU
      
      As per the XLA document XLA cannot handle masked indexing well. So token classification
      models for BERT and others use an implementation based on `torch.where`. This implementation
      works well on TPU. 
      
      ALBERT token classification model uses the masked indexing which causes performance issues
      on TPU. This PR fixes this issue by following the BERT implementation.
      
      * Same fix for ELECTRA
      
      * Same fix for LayoutLM
      eae7a96b
  32. 31 Aug, 2021 1 commit
  33. 23 Aug, 2021 1 commit
  34. 12 Aug, 2021 1 commit
    • Ibraheem Moosa's avatar
      Fix classifier dropout in AlbertForMultipleChoice (#13087) · 3f52c685
      Ibraheem Moosa authored
      Classification head of AlbertForMultipleChoice uses `hidden_dropout_prob` instead of `classifier_dropout_prob`.  This
      is not desirable as we cannot change classifer head dropout probability without changing the dropout probabilities of
      the whole model.
      3f52c685
  35. 06 Aug, 2021 1 commit
    • Sylvain Gugger's avatar
      Tpu tie weights (#13030) · 7fcee113
      Sylvain Gugger authored
      * Fix tied weights on TPU
      
      * Manually tie weights in no trainer examples
      
      * Fix for test
      
      * One last missing
      
      * Gettning owned by my scripts
      
      * Address review comments
      
      * Fix test
      
      * Fix tests
      
      * Fix reformer tests
      7fcee113
  36. 26 Jul, 2021 1 commit
  37. 28 Jun, 2021 1 commit
  38. 22 Jun, 2021 1 commit
    • Hamid Shojanazeri's avatar
      Fix for the issue of device-id getting hardcoded for token_type_ids during Tracing [WIP] (#11252) · af6e01c5
      Hamid Shojanazeri authored
      
      
      * registering a buffer for token_type_ids, to pass the error of device-id getting hardcoded when tracing
      
      * sytle format
      
      * adding persistent flag to the resgitered buffers that prevent from adding them to the state_dict and addresses the Backward compatibility issue
      
      * adding the try catch to the fix as persistent flag is only available from PT >1.6
      
      * adding version check
      
      * added the condition to only use the token_type_ids buffer when its autogenerated not passed by user
      
      * adding comments and making the conidtion where token_type_ids are None to use the registered buffer
      
      * taking out position-embeddding from the if block
      
      * adding comments
      
      * handling the case if buffer for position_ids was not registered
      
      * reverted the changes on position_ids, fix the issue with size of token_type_ids buffer, moved the modification for generated token_type_ids to Bertmodel, instead of Embeddings
      
      * reverting the token_type_ids in case of None to the previous version
      
      * reverting changes on position_ids adding back the if block
      
      * changes added by running make fix-copies
      
      * changes added by running make fix-copies and added the import version as it was getting used
      
      * changes added by running make fix-copies
      
      * changes added by running make fix-copies
      
      * fixing the import format
      
      * fixing the import format
      
      * modified to use temp tensor for trimed and expanded token_type_ids buffer
      
      * changes made by fix-copies after temp tensor modifications
      
      * changes made by fix-copies after temp tensor modifications
      
      * changes made by fix-copies after temp tensor modifications
      
      * clean up
      
      * clean up
      
      * clean up
      
      * clean up
      
      * Nit
      
      * Nit
      
      * Nit
      
      * modified according to support device conversion on traced models
      
      * modified according to support device conversion on traced models
      
      * modified according to support device conversion on traced models
      
      * modified according to support device conversion on traced models
      
      * changes based on latest in master
      
      * Adapt templates
      
      * Add version import
      Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-32-81.us-west-2.compute.internal>
      Co-authored-by: default avatarLysandre <lysandre.debut@reseau.eseo.fr>
      af6e01c5
  39. 14 Jun, 2021 1 commit