1. 20 Jul, 2023 1 commit
  2. 21 Jun, 2023 1 commit
  3. 07 Mar, 2023 1 commit
  4. 19 Jan, 2023 1 commit
    • Karim Foda's avatar
      Add hallucination filter (#18675) · b9403e95
      Karim Foda authored
      
      
      * Add hallucination penalty
      
      * Make quality changes
      
      * Inverse penalty
      
      * Fix imports & quality
      
      * Fix name spelling issue
      
      * set encoder_repetition_penalty and fix quality
      
      * Fix failing test
      
      * Add to config_common_kwargs
      
      * Fix modelling_rag error
      
      * Update src/transformers/generation_logits_process.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Remove breakpoint
      
      * Make style fixes
      
      * Update encoder_repetition_penalty default value
      
      * Merge latest main changes
      
      * Make fixup changes
      
      * Add EncoderRepetitionPenaltyLogitsProcessor to generation/__init__.py
      
      * Fix repo-inconsistency
      
      * Remove venv
      
      * Remove tensorflow-macos & add tests
      
      * Add documentation
      
      * Fix quality issues
      
      * move encoder_repetition_penalty to config
      
      * Update src/transformers/configuration_utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Update src/transformers/generation/configuration_utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Remove encoder_repetition_penalty from tests
      
      * Fix type error
      
      * Fix format error
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      b9403e95
  5. 17 Jan, 2023 1 commit
    • Sherman Siu's avatar
      Add Epsilon- and Eta-Sampling (#21121) · 865da84a
      Sherman Siu authored
      * Add epsilon- and eta-sampling.
      
      Add epsilon- and eta-sampling, following the official code from https://github.com/john-hewitt/truncation-sampling and adapting to be more configurable, as required by Huggingface transformers.
      
      * Add unit tests for epsilon- and eta-sampling.
      
      * Black: fix code formatting.
      
      * Fix docstring spacing.
      
      * Clean up newlines.
      
      * Fix implementation bugs and their associated tests.
      
      * Remove epsilon- and eta-sampling parameters from PretrainedConfig.
      
      * Clarify and clean up the documentation.
      
      * Remove parameters for PretrainedConfig test.
      865da84a
  6. 03 Jan, 2023 1 commit
    • Konstantin Kotik's avatar
      `MinNewTokensLengthLogitsProcessor` for `.generate` method #20814 (#20892) · 367fdf33
      Konstantin Kotik authored
      
      
      * feat: add min new length logit processor
      
      * test: add min new length logit processor
      
      * docs: add MinNewTokensLengthLogitsProcessor
      
      * feat: import MinNewTokensLengthLogitsProcessor
      
      * fix: update pytorch dummy objects
      
      * refactor & fix: rename attributes and var and get rid of dynamic attribute
      
      * tests: align test with new interface
      
      * docs: fix typo
      
      * docs: minor clarification
      
      * Empty-Commit
      
      * empty commit
      
      * run automated quality edits
      Co-authored-by: default avatarJoao Gante <joao@huggingface.co>
      367fdf33
  7. 09 Nov, 2022 1 commit
  8. 15 Sep, 2022 1 commit
  9. 13 Apr, 2022 1 commit
  10. 06 Apr, 2022 1 commit
  11. 11 Mar, 2022 1 commit
    • Kevin Bondzio's avatar
      Add soft length regulation for sequence generation (#15245) · 9442b3ce
      Kevin Bondzio authored
      
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix test config, fix formatting
      
      * fix rag integration, fix docstyling
      
      * fix wrong docstring
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * change test according to new param
      
      * fix formatting
      
      * fix test case
      
      * fix doc style
      
      * move start_length calculation to Logitprocessor
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix rag integration, fix docstyling
      
      * fix test config, fix formatting
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * remove unused import
      
      * fix small errors
      
      * fix test
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix test config, fix formatting
      
      * fix rag integration, fix docstyling
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * change test according to new param
      
      * fix test case
      
      * move start_length calculation to Logitprocessor
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix rag integration, fix docstyling
      
      * fix test config, fix formatting
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix test config, fix formatting
      
      * fix rag integration, fix docstyling
      
      * add possibility to softly regulate length when using sampling method in model.generate() function
      
      * fix rag integration, fix docstyling
      
      * change param to tuple, add test
      
      * fix old param in rag_model, remove unused import
      
      * fix small errors
      
      * Update src/transformers/generation_utils.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Update src/transformers/generation_utils.py
      
      * Update src/transformers/generation_utils.py
      
      * fix docstring, add type ind model rag
      
      * fix docstrings
      
      * introduce seq_length variable for cleaner code
      
      * fix black formatting
      
      * add input_ids_seq_length to modeling_rag
      
      * add input_ids_seq_length to test
      
      * retrigger checks
      
      * retrigger checks
      Co-authored-by: default avatarKevin Bondzio <kev@AIM-LAP-02.local>
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarKevin Bondzio <kev@AIM-LAP-02.fritz.box>
      9442b3ce
  12. 02 Mar, 2022 1 commit
  13. 23 Feb, 2022 1 commit
  14. 09 Feb, 2022 1 commit
  15. 14 Jun, 2021 1 commit
  16. 22 Mar, 2021 1 commit
  17. 10 Feb, 2021 1 commit
    • Suraj Patil's avatar
      remove adjust_logits_during_generation method (#10087) · c130e67d
      Suraj Patil authored
      * add forced logits processors
      
      * delete adjust_logits method
      
      * add forced_eos_token_id argument in config
      
      * add tests for forced logits processors
      
      * update gen utils tests
      
      * add forced option to tf generate
      
      * remove adjust_logits method from tf models
      
      * update adjust_logits for marian
      
      * delete _force_token_id_to_be_generated method
      
      * style
      
      * import warnings
      
      * pass max_length to _get_logits_processor
      
      * set forced_eos_token_id to None
      
      * set forced attributes in conf utils
      
      * typo
      
      * fix rag generate
      
      * add forced_eos_token_id in rag config
      
      * remove force_bos_token_to_be_generated from BartConfig
      
      * remove _force_token_ids_generation from FSMT
      
      * nit
      
      * fix negative constant
      
      * apply suggestions from code review
      c130e67d
  18. 04 Feb, 2021 1 commit
  19. 09 Dec, 2020 1 commit
    • 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
  20. 18 Nov, 2020 1 commit
  21. 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