• Nicolas Patry's avatar
    Removed `max_length` from being mandatory within `generate`. (#11314) · aad95c7c
    Nicolas Patry authored
    * Removed `max_length` from being mandatory within `generate`.
    
    - Moving on to fully using `StoppingCriteria` for `greedy` and `sample`
    modes.
    - `max_length` still used for `beam_search` and `group_beam_search`
    (Follow up PR)
    - Fixes a bug with MaxLengthStoppingCriteria (we should stop as soon a
    we hit the max_length, the comparison needs to be or equal, that affects
    the tests).
    - Added options to use `logits_processor` and `stopping_criteria`
    directly within `generate` function (so some users can define their own
    `logits_processor` and `stopping_criteria`).
    - Modified the backward compat tests to make sure we issue a warning.
    
    * Fix `max_length` argument in `generate`.
    
    * Moving validate to being functional.
    
    - Renamed `smax_length` to `stoppping_max_length`.
    
    * Removing `logits_processor` and `stopping_criteria` from `generate`
    arguments.
    
    * Deepcopy.
    
    * Fix global variable name.
    aad95c7c
test_generation_stopping_criteria.py 2.38 KB