-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make docstring match args #4711
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4711 +/- ##
==========================================
- Coverage 77.32% 77.14% -0.19%
==========================================
Files 128 128
Lines 21071 21071
==========================================
- Hits 16294 16256 -38
- Misses 4777 4815 +38
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks @sgugger ! At some point we would like to have labels
on every model, rather than labels
on some, masked_lm_labels
on others and lm_labels
on others. We would need to deprecate the current lm_labels
and masked_lm_labels
while keeping them in the signature to keep backwards compatibility.
For reference: #4055, #4198 (comment) (cc @thomwolf, @patrickvonplaten, @julien-c)
I can work on this if there is no one on it. Quick question though: what about the models that have both |
Yes, that's the case for As with this update we're trying to have the exact same API for all models so that the training/inference code is model agnostic, I'd say that we should look for the most natural on a case-by-case basis. For example with the |
As far as I know, @sgugger - In the encoder-decoder model I added both |
@patrickvonplaten good for me |
When replying to #4698, I realized some language model docstrings are using arguments that are not present in the function signature. This PR addresses that (for all the ones I found at least).
The alternative would be to change the argument names in the function signatures (if it makes the various model APIs more consistent).