1. 12 Aug, 2021 1 commit
  2. 08 Jul, 2021 1 commit
  3. 16 Jun, 2021 1 commit
  4. 02 Jun, 2021 1 commit
  5. 26 May, 2021 1 commit
    • Patrick von Platen's avatar
      Flax Generate (#11777) · 996a315e
      Patrick von Platen authored
      
      
      * fix_torch_device_generate_test
      
      * remove @
      
      * add
      
      * indexing
      
      * correct a couple of tests
      
      * fix tests
      
      * add logits processor
      
      * finish top_k, top_p, temp
      
      * add docs
      
      * correct flax prng key default
      
      * improve generate
      
      * add generation docs
      
      * add docs
      
      * make style
      
      * revert model outputs change
      
      * make style
      
      * correct typo
      
      * fix tests
      
      * fix slow test
      
      * add raise
      
      * finish generation
      Co-authored-by: default avatarPatrick von Platen <patrick@huggingface.co>
      996a315e
  6. 30 Apr, 2021 1 commit
  7. 29 Mar, 2021 1 commit
  8. 22 Mar, 2021 1 commit
  9. 12 Mar, 2021 1 commit
    • Nicolas Patry's avatar
      Adding new parameter to `generate`: `max_time`. (#9846) · 543d0549
      Nicolas Patry authored
      * [WIP] Adding new parameter to `generate`:  `max_time`.
      
      Generation by tokens number is sometimes a bit clunky because we don't
      know how many tokens are good enough or even how many tokens are in
      the payload (for pipelines users for instance). This leads to hard
      to understand behavior.
      
      This PR proposes a new argument `max_time` which is a float of seconds
      for the allowed time for `generate` to run on.
      Ideally combinations of `max_tokens=None`, `max_time=2` could be used to
      generate as many tokens as possible within time budget.
      
      NB: Another possible approach consists of passing a callback to `generate`
        putting the caller in charge of the actual decision of when to stop
        generating tokens. It opens the door to 'which args should we pass'
        to this callback. It's hard to imagine other use-cases for this
        early stopping behavior than time (that are not already covered by
        parameters of generate)
      
      * Revamp with StoppingCriteria
      
      * Removing deprecated mentions.
      
      * Forgot arguments to stopping criteria.
      
      * Readding max_length it's not just used as a stopping criteria.
      
      * Default value for `stopping_criteria`.
      
      * Address @patrickvonplaten comments.
      
      - More docstrings
      - Actual doc
      - Include in global namespace
      - Remove TF work.
      
      * Put back `max_length` (deprecation different PR).
      
      * Doc quality.
      
      * Fixing old behavior without `stopping_criteria` but with `max_length`.
      
      Making sure we don't break that in the future.
      
      * Adding more tests for possible inconsistencies between
      
      `max_length` and `stopping_criteria`.
      
      * Fixing the torch imports.
      543d0549
  10. 28 Feb, 2021 1 commit
  11. 25 Feb, 2021 1 commit
    • Patrick von Platen's avatar
      [PretrainedFeatureExtractor] + Wav2Vec2FeatureExtractor, Wav2Vec2Processor,... · cb38ffcc
      Patrick von Platen authored
      [PretrainedFeatureExtractor] + Wav2Vec2FeatureExtractor, Wav2Vec2Processor, Wav2Vec2Tokenizer (#10324)
      
      * push to show
      
      * small improvement
      
      * small improvement
      
      * Update src/transformers/feature_extraction_utils.py
      
      * Update src/transformers/feature_extraction_utils.py
      
      * implement base
      
      * add common tests
      
      * make all tests pass for wav2vec2
      
      * make padding work & add more tests
      
      * finalize feature extractor utils
      
      * add call method to feature extraction
      
      * finalize feature processor
      
      * finish tokenizer
      
      * finish general processor design
      
      * finish tests
      
      * typo
      
      * remove bogus file
      
      * finish docstring
      
      * add docs
      
      * finish docs
      
      * small fix
      
      * correct docs
      
      * save intermediate
      
      * load changes
      
      * apply changes
      
      * apply changes to doc
      
      * change tests
      
      * apply surajs recommend
      
      * final changes
      
      * Apply suggestions from code review
      
      * fix typo
      
      * fix import
      
      * correct docstring
      cb38ffcc
  12. 06 Jan, 2021 1 commit
    • 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
  13. 14 Dec, 2020 1 commit
    • 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
  14. 10 Dec, 2020 1 commit
  15. 09 Dec, 2020 2 commits
    • Patrick von Platen's avatar
      push (#9008) · da37a21c
      Patrick von Platen authored
      da37a21c
    • Patrick von Platen's avatar
      Diverse beam search 2 (#9006) · 02d0e035
      Patrick von Platen authored
      
      
      * diverse beam search
      
      * bug fixes
      
      * bug fixes
      
      * bug fix
      
      * separate out diverse_beam_search function
      
      * separate out diverse_beam_search function
      
      * bug fix
      
      * improve code quality
      
      * bug fix
      
      * bug fix
      
      * separate out diverse beam search scorer
      
      * code format
      
      * code format
      
      * code format
      
      * code format
      
      * add test
      
      * code format
      
      * documentation changes
      
      * code quality
      
      * add slow integration tests
      
      * more general name
      
      * refactor into logits processor
      
      * add test
      
      * avoid too much copy paste
      
      * refactor
      
      * add to docs
      
      * fix-copies
      
      * bug fix
      
      * Revert "bug fix"
      
      This reverts commit c99eb5a8dc57a7b0d33a8ac06d8c6a32a7812ad4.
      
      * improve comment
      
      * implement sylvains feedback
      Co-authored-by: default avatarAyush Jain <a.jain@sprinklr.com>
      Co-authored-by: default avatarayushtiku5 <40797286+ayushtiku5@users.noreply.github.com>
      02d0e035
  16. 07 Dec, 2020 1 commit
  17. 03 Nov, 2020 1 commit
    • Patrick von Platen's avatar
      Refactoring the generate() function (#6949) · a1bbcf3f
      Patrick von Platen authored
      * first draft
      
      * show design proposition for new generate method
      
      * up
      
      * make better readable
      
      * make first version
      
      * gpt2 tests pass
      
      * make beam search for gpt2 work
      
      * add first encoder-decoder code
      
      * delete typo
      
      * make t5 work
      
      * save indermediate
      
      * make bart work with beam search
      
      * finish beam search bart / t5
      
      * add default kwargs
      
      * make more tests pass
      
      * fix no bad words sampler
      
      * some fixes and tests for all distribution processors
      
      * fix test
      
      * fix rag slow tests
      
      * merge to master
      
      * add nograd to generate
      
      * make all slow tests pass
      
      * speed up generate
      
      * fix edge case bug
      
      * small fix
      
      * correct typo
      
      * add type hints and docstrings
      
      * fix typos in tests
      
      * add beam search tests
      
      * add tests for beam scorer
      
      * fix test rag
      
      * finish beam search tests
      
      * move generation tests in seperate file
      
      * fix generation tests
      
      * more tests
      
      * add aggressive generation tests
      
      * fix tests
      
      * add gpt2 sample test
      
      * add more docstring
      
      * add more docs
      
      * finish doc strings
      
      * apply some more of sylvains and sams comments
      
      * fix some typos
      
      * make fix copies
      
      * apply lysandres and sylvains comments
      
      * final corrections on examples
      
      * small fix for reformer
      a1bbcf3f
  18. 26 Oct, 2020 1 commit
    • Sylvain Gugger's avatar
      Doc styling (#8067) · 08f534d2
      Sylvain Gugger authored
      * Important files
      
      * Styling them all
      
      * Revert "Styling them all"
      
      This reverts commit 7d029395fdae8513b8281cbc2a6c239f8093503e.
      
      * Syling them for realsies
      
      * Fix syntax error
      
      * Fix benchmark_utils
      
      * More fixes
      
      * Fix modeling auto and script
      
      * Remove new line
      
      * Fixes
      
      * More fixes
      
      * Fix more files
      
      * Style
      
      * Add FSMT
      
      * More fixes
      
      * More fixes
      
      * More fixes
      
      * More fixes
      
      * Fixes
      
      * More fixes
      
      * More fixes
      
      * Last fixes
      
      * Make sphinx happy
      08f534d2
  19. 14 Oct, 2020 1 commit
  20. 07 Oct, 2020 1 commit
    • Sylvain Gugger's avatar
      Trainer callbacks (#7596) · 08ba4b49
      Sylvain Gugger authored
      
      
      * Initial callback proposal
      
      * Finish various callbacks
      
      * Post-rebase conflicts
      
      * Fix tests
      
      * Don't use something that's not set
      
      * Documentation
      
      * Remove unwanted print.
      
      * Document all models can work
      
      * Add tests + small fixes
      
      * Update docs/source/internal/trainer_utils.rst
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Address review comments
      
      * Fix TF tests
      
      * Real fix this time
      
      * This one should work
      
      * Fix typo
      
      * Really fix typo
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      08ba4b49
  21. 23 Sep, 2020 1 commit
  22. 03 Aug, 2020 1 commit
  23. 30 Jul, 2020 1 commit
  24. 24 Jul, 2020 1 commit