Fix always issuing generation deprecation warning#43389
Fix always issuing generation deprecation warning#43389ydshieh merged 1 commit intohuggingface:mainfrom
Conversation
c926f83 to
aeb8ffe
Compare
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
zucchini-nlp
left a comment
There was a problem hiding this comment.
Thanks, one tiny question and then feel free to merge :)
| try: | ||
| # Providing generation_config and kwargs is deprecated, so we expect a warning here. | ||
| # | ||
| # We're using logging_once, make sure that we emit this warning in any case by clearing the |
There was a problem hiding this comment.
nit: what is the purpose of try, and can we let it fail explicitly to know that this test has issues instead of silent skip
There was a problem hiding this comment.
try without except doesn't catch the exceptions, it executes the code in try and then invokes finally to clean up - that's the only purpose of this construct is to remove the logging handler after the test is done in any case (exception thrown because of assertion failure or not)
Commit 38e5987 from PR huggingface#43194 introduced a minor bug that causes the issuing of a deprecation warning regardless of the user using the deprecated interface. For example: ``` model.generate(**input_ids, do_sample=False) ``` would issue a deprecation warning not to pass `GenerationConfig` as well as generation kwargs even though we're not passing a `GenerationConfig`. Along the fix this also introduces a unit test to check both the intended and the bug behavior.
aeb8ffe to
e7cd078
Compare
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=43389&sha=e7cd07 |
Commit 38e5987 from PR huggingface#43194 introduced a minor bug that causes the issuing of a deprecation warning regardless of the user using the deprecated interface. For example: ``` model.generate(**input_ids, do_sample=False) ``` would issue a deprecation warning not to pass `GenerationConfig` as well as generation kwargs even though we're not passing a `GenerationConfig`. Along the fix this also introduces a unit test to check both the intended and the bug behavior. Co-authored-by: nemo <git@ningu.net>
Commit 38e5987 from PR huggingface#43194 introduced a minor bug that causes the issuing of a deprecation warning regardless of the user using the deprecated interface. For example: ``` model.generate(**input_ids, do_sample=False) ``` would issue a deprecation warning not to pass `GenerationConfig` as well as generation kwargs even though we're not passing a `GenerationConfig`. Along the fix this also introduces a unit test to check both the intended and the bug behavior. Co-authored-by: nemo <git@ningu.net>
What does this PR do?
Note: already discussed with @zucchini-nlp internally
Commit 38e5987 from PR #43194 introduced a minor bug that causes the issuing of a deprecation warning regardless of the user using the deprecated interface.
For example:
would issue a deprecation warning not to pass
GenerationConfigas well as generation kwargs even though we're not passing aGenerationConfig.Along the fix this also introduces a unit test to check both the intended and the bug behavior.